Posts from C++

Knuth-Morris-Pratt (KMP) Algorithm in C++

By Prayas Sambhare

In this tutorial, we are going to learn about the KMP algorithm in C++ with code implementation. There are other algorithms like Naive Algorithm and Rabin Karp Algorithm which are.... Read More

Longest Proper Prefix Suffix Array in C++ efficient approach(precursor to KMP algorithm)

By Prayas Sambhare

In this tutorial, we are going to learn about how to construct the longest proper prefix suffix array(LPS array) in C++. In this blog, we are going to discuss an efficient solution.... Read More

How to Sort an Array contains 0s,1s ,2s in C++

By Rahul Ranjan

Hello Friends, Today we are going to learn how to sort an array containing elements as 0,1,2 in C++ program. It seems like an easy question but to solve it with an efficient approa.... Read More

Longest Proper Prefix Suffix Array in C++ naive approach

By Prayas Sambhare

Hello friends, today we are going to learn about how to construct the longest proper prefix suffix array (LPS array) in C++. Though for many people, this topic may look completely .... Read More

C++ program to Check if all leaves are at same level

By Shoif Md Mia

A node of a tree is called leaf when it’s both the children are NULL. Now, in a given binary tree, we have to check whether all the leaves are at the same level. In this tree.... Read More

Rabin Karp algorithm for pattern matching in C++

By Prayas Sambhare

In this tutorial, we are going to learn about the Rabin Karp algorithm in C++ with code implementation. Rabin Karp algorithm is an optimization of the naive algorithm which is O(n*.... Read More

Merge two std::queue in C++

By Shoif Md Mia

Queue is a data structure that follows FIFO (first in first out) manner. In a queue, we can push values of similar (fixed for a queue) data type. If we try to pop an element then t.... Read More

Shortest path in an unweighted graph in C++

By Shoif Md Mia

In an unweighted graph from a source to the destination, we may have several paths. We have to find out the shortest path among all in C++. Let’s have an example: Our graph b.... Read More

Related Posts