Skip to content

Category Archives: C++ Programs

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 of 0s, 1s and 2s, sort it.Examples: Input: 1 -> 1 -> 2 -> 0 -> 2 -> 0 -> 1… 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
This article discusses the basics of linear regression and its implementation in the C++ programming language. Regression analysis is the common analysis method that is… Read More
This article focuses on function/method overloads by references, as well as the types of arguments that can be passed. Prerequisites: l-value references. r-value references. Move… Read More

Start Your Coding Journey Now!