Skip to content

Category Archives: C++ Programs

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 an unsorted array of nonnegative integers, find a continuous subarray which adds to a given number. Examples :  Input: arr[] = {1, 4, 20, 3,… Read More
Given a linked list, find the length of the longest palindrome list that exists in that linked list.  Examples:  Input : List = 2->3->7->3->2->12->24 Output… 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 two strings, represented as linked lists (every character is a node in a linked list). Write a function compare() that works similar to strcmp(),… Read More
Given a linked list that is sorted based on absolute values. Sort the list based on actual values.Examples:  Input: 1 -> -10 Output: -10 ->… 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 an expression string exp, write a program to examine whether the pairs and the orders of “{“, “}”, “(“, “)”, “[“, “]” are correct… Read More
Write a function to check whether two given strings are anagram of each other or not. An anagram of a string is another string that… Read More
Given a linked list and two integers M and N. Traverse the linked list such that you retain M nodes then delete next N nodes,… 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 two positive integers x and y, check if one integer is obtained by rotating bits of other.  Input constraint: 0 < x, y <… Read More

Start Your Coding Journey Now!