Skip to content

Category Archives: C++ Programs

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 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
Given N numbers with no duplicates, count the number of unique triplets (ai, aj, ak) such that their XOR is 0. A triplet is said… Read More
Given an integer x, the task is to find if every k-cycle shift on the element produces a number greater than or equal to the… Read More
Given two numbers represented by linked lists, write a function that returns the multiplication of these two linked lists. Examples:  Input: 9->4->6 8->4 Output: 79464… Read More
Given a string S of lowercase English alphabets, the task is to find the minimum number of characters to be changed such that the left… Read More
Given a matrix of size N*M, and a number K. We have to rotate the matrix K times to the right side. Examples:   Input : N… Read More
An array contains both positive and negative numbers in random order. Rearrange the array elements so that positive and negative numbers are placed alternatively. Number… Read More
Given an n x n matrix .In the given matrix, you have to print the elements of the matrix in the snake pattern. Examples : … Read More

Start Your Coding Journey Now!