# Category Archives: C++ Programs

What is the Arduino library? Libraries are a collection of precompiled, reusable code or routines which are used by developers to reduce the development time.… Read More
Given an array of n numbers. The problem is to move all the 0’s to the end of the array while maintaining the order of… Read More
Given a string, we need to find the minimum number of rotations required to get the same string. Examples: Input : s = "geeks" Output… Read More
You are given an array A[] of n-elements and a positive integer k (k > 1). Now you have find the number of pairs Ai,… Read More
Given an increasing sequence a[], we need to find the K-th missing contiguous element in the increasing sequence which is not present in the sequence.… Read More
Given a m x n 2D matrix, check if it is a Markov Matrix.Markov Matrix : The matrix in which the sum of each row… Read More
Given a square matrix, mat[][] of dimensions N * N, the task is find the maximum sum of diagonal elements possible from the given matrix… Read More
Given two arrays arr1[] and arr2[] of N integers and array arr1[] has distinct elements. The task is to find the maximum count of corresponding… Read More
Insert a node x after the nth node from the end in the given singly linked list. It is guaranteed that the list contains the… Read More
Problem Statement: Given a set of strings, find the longest common prefix.Examples:   Input: {"geeksforgeeks", "geeks", "geek", "geezer"} Output: "gee" Input: {"apple", "ape", "april"} Output: "ap"… Read More
Write a function detectAndCountLoop() that checks whether a given Linked List contains loop and if loop is present then returns count of nodes in loop.… Read More
We are given a row-wise sorted matrix of size r*c, we need to find the median of the matrix given. It is assumed that r*c… Read More
Given an array arr[] of N integers and Q queries of the form {X, Y} of the following two types: If X = 1, rotate… Read More
Given a doubly linked list, rotate the linked list counter-clockwise by N nodes. Here N is a given positive integer and is smaller than the… Read More
Given an array, a positive integer, sort the array in ascending order such that the element at index K in the unsorted array stays unmoved… Read More