In this tutorial, we will learn to find run length encoding of a string in c++. For Example: Given string: “ssshhhhhaiiiiillllll” Now, encode the length of every char.... Read More
In this tutorial, we will learn to reverse a string using the stack in C++. For Example: Given string: " codespeedy" Reverse the given string. Output: " ydeepsdoc'' Simple Method: .... Read More
In this tutorial, we will learn to print the pyramidical star pattern in C++. For Example: If n=5. The output: * * * * * * * * * * * * * * * Approach: Firstly, it is a star pattern.... Read More
In this tutorial, we will learn to replace the element with the greatest element on the right side in C++. Also, we have given an array and we have to replace the element with the .... Read More
In this tutorial, we will learn to find a pair with the given difference in C++. Also, we have given an array and a number n and our task is to get the pair whose difference is the.... Read More
In this tutorial, we will learn to push all zeroes to the end of an array in C++. As we have given an array and we have to shift zeroes to the end of the array. For Example: Give.... Read More
In this tutorial, we will learn how to count pairs in an array whose sum is divisible by K in C++. Also, given an array and a number K, and we have to count pairs. For example: Giv.... Read More
In this tutorial, we will learn about topological sort and its implementation in C++. Before that let’s first understand what is directed acyclic graph. Directed Acyclic Grap.... Read More