Given non-negative integers K, M, and an array arr[ ] consisting of N elements, the task is to find the Mth element of the array… Read More

# Category Archives: C++ Programs

Given non-negative integers K, M, and an array arr[] with N elements find the Mth element of the array after K left rotations. Examples: Input:… Read More

Given an array A[ ] consisting of N distinct integers, the task is to find the number of elements which are strictly greater than all… Read More

Given an array arr[], the task is to find the number of rotations required to convert the given array to sorted form.Examples: Input: arr[] =… Read More

Given an integer array arr[] of size N, the task is to print all possible rotations of the array.Examples: Input: arr[] = {1, 2, 3,… Read More

Given an array A[] of length N, where N is an even number, the task is to answer Q independent queries where each query consists… Read More

Given an array arr consisting of N elements and Q queries of the following two types: 1 K: For this type of query, the array… Read More

Given a N x N matrix, such that the element at the index [N/2, N/2] is missing, the task is to find the maximum integer… Read More

Given two linked lists that represent two large positive numbers. Subtract the smaller number from the larger one and return the difference as a linked… Read More

Given a matrix and the task is to check matrix is involutory matrix or not. Involutory Matrix: A matrix is said to be involutory matrix if… Read More

Given a linked list and two positions ‘m’ and ‘n’. The task is to rotate the sublist from position m to n, to the right… Read More

Given a N * N matrix and the task is to check matrix is idempotent matrix or not.Idempotent matrix: A matrix is said to be… Read More

Given two permutations P1 and P2 of numbers from 1 to N, the task is to find the maximum count of corresponding same elements in… Read More

Given n strings that are permutations of each other. We need to make all strings same with an operation that takes front character of any… Read More

Given an array of n elements. Our task is to write a program to rearrange the array such that elements at even positions are greater… Read More