# Category Archives: C++

Given a matrix of n*n size, the task is to find whether all rows are circular rotations of each other or not.  Examples:  Input: mat[][]â€¦ Read More
Given a positive integer n which represents the dimensions of a 4n x 4n matrix with values from 1 to n filled from left toâ€¦ Read More
Given a linked list, write a function to reverse every k nodes (where k is an input to the function).Â  Example:Â  Input: 1->2->3->4->5->6->7->8->NULL, K =â€¦ Read More
Given an array arr[] of size n and integer k such that k using namespace std;    // Prints beginning and ending indexes of subarrayâ€¦ Read More
Write code to find lexicographic minimum in a circular array, e.g. for the array BCABDADAB, the lexicographic minimum is ABBCABDAD.Source: Google Written TestMore Examples:Â  Input:â€¦ Read More
Write a function rotate(ar[], d, n) that rotates arr[] of size n by d elements.  Rotation of the above array by 2 will make arrayâ€¦ Read More
We have introduced Linked Lists in the previous post. We also created a simple linked list with 3 nodes and discussed linked list traversal.All programsâ€¦ Read More
Given a singly linked list of characters, write a function that returns true if the given list is a palindrome, else false. Recommended: Please solveâ€¦ Read More
Given an array of random numbers, Push all the zero’s of a given array to the end of the array. For example, if the givenâ€¦ Read More
Given a sorted array and a value x, the ceiling of x is the smallest element in array greater than or equal to x, andâ€¦ Read More
Given a linked list of 0s, 1s and 2s, sort it.Examples: Input: 1 -> 1 -> 2 -> 0 -> 2 -> 0 -> 1â€¦ Read More
Question: Write a function to find if a given integer x appears more than n/2 times in a sorted array of n integers. Basically, we needâ€¦ Read More
Given a square matrix of order n*n, find the maximum and minimum from the matrix given.  Examples:  Input : arr[][] = {5, 4, 9, 2,â€¦ Read More
Given a binary array sorted in non-increasing order, count the number of 1’s in it.Â  Examples:Â  Input: arr[] = {1, 1, 0, 0, 0, 0,â€¦ Read More
Given two positive integers x and y, check if one integer is obtained by rotating bits of other.  Input constraint: 0 < x, y <â€¦ Read More