Skip to content

Category Archives: C++ Programs

Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge uv, vertex u comes before v… Read More
Heap sort is a comparison based sorting technique based on Binary Heap data structure. It is similar to selection sort where we first find the… Read More
Given a number n, print all primes smaller than or equal to n. It is also given that n is a small number. For example,… Read More
LCS Problem Statement: Given two sequences, find the length of longest subsequence present in both of them. A subsequence is a sequence that appears in… Read More
The Longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence of a given sequence such that all elements of the… Read More
The Longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence of a given sequence such that all elements of the… Read More
In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation Fn = Fn-1 + Fn-2 with seed valuesWe provide nothing… Read More
Given a string s1 and a string s2, write a snippet to say whether s2 is a rotation of s1? (eg given s1 = ABCD… Read More
Given an array arr[] consisting of positive integers that occur even number of times, except one number, which occurs odd number of times. The task… Read More
Given a positive integer, write a function to find if it is a power of two or not.Examples :   Input : n = 4 Output… Read More

Start Your Coding Journey Now!