Skip to content

Category Archives: C++ Programs

Given two strings str1 and str2 and an integer d, the task is to check whether str2 can be obtained by rotating str1 by d… Read More
Given a matrix mat[][] of dimensions M * N, the task is to print the matrix obtained after rotating every ith row of the matrix… Read More
Given a set of integers of N elements. The task is to print the absolute difference of all of the pairwise consecutive elements in a… Read More
Given a linked list, the task is to make a function which checks whether the length of the linked list is even or odd.  Examples:… Read More
Given a square matrix and the task is to check the matrix is in upper triangular form or not. A square matrix is called upper… Read More
Given an integer X and two strings S1 and S2, the task is to check that string S1 can be converted to the string S2… Read More
Given a linked list of 0s, 1s and 2s, sort it.Examples: Input: 2->1->2->1->1->2->0->1->0 Output: 0->0->1->1->1->1->2->2->2 The sorted Array is 0, 0, 1, 1, 1, 1,… Read More
Given an array arr[] consisting of N integers, the task is to sort the array in non-increasing order by minimum number of anti-clockwise rotations. If… Read More
Given a permutation arrays A[] consisting of N numbers in range [1, N], the task is to left rotate all the even numbers and right… Read More
Given a large positive number as string, count all rotations of the given number which are divisible by 8. Examples:  Input: 8 Output: 1 Input:… Read More
A matrix is a two-dimensional data object having m rows and n columns, therefore a total of m*n values. If most of the values of… Read More
An array is given of n length, and problem is that we have to find the length of shortest unordered {neither increasing nor decreasing} sub… Read More
Given k linked lists each of size n and each list is sorted in non-decreasing order, merge them into a single sorted (non-decreasing order) linked… Read More
Given two integers N and K, the task is to rotate the digits of N by K. If K is a positive integer, left rotate… Read More

Start Your Coding Journey Now!