Skip to content

Category Archives: C++ Programs

Given an array arr of size N, the task is to find the largest element in the given array.  Example:  Input: arr[] = {10, 20,… Read More
Given an infinite stream of integers, find the k’th largest element at any point of time.Example:  Input: stream[] = {10, 20, 11, 70, 50, 40,… Read More
Given an array and a value, find if there is a triplet in array whose sum is equal to the given value. If there is… Read More
Given a string S, the task is to remove all the duplicates in the given string. Below are the different methods to remove duplicates in a… Read More
Given two polynomial numbers represented by a linked list. Write a function that add these lists means add the coefficients who have same variable powers.Example:  … Read More
Given an array arr[] of size n. Three elements arr[i], arr[j] and arr[k] form an inversion of size 3 if a[i] > a[j] >a[k] and… Read More
Given a Singly Linked List, starting from the second node delete all alternate nodes of it. For example, if the given linked list is 1->2->3->4->5… Read More
Given two linked lists, insert nodes of second list into first list at alternate positions of first list. For example, if first list is 5->7->17->13->11 and… Read More
Given a linked list with a loop, the task is to find whether it is palindrome or not. You are not allowed to remove the… Read More
Given two numbers represented by two linked lists, write a function that returns the sum list. The sum list is linked list representation of the… Read More
Given an array of n non-negative integers. The task is to find frequency of a particular element in the arbitrary range of array[]. The range… Read More
Given a linked list, print reverse of it using a recursive function. For example, if the given linked list is 1->2->3->4, then output should be… Read More
Given an array of numbers, arrange them in a way that yields the largest value. For example, if the given numbers are {54, 546, 548,… Read More
Algorithm For C++:Iterate through the linked list and delete all the nodes one by one. The main point here is not to access the next… Read More
Given a matrix mat[][] of size N*N, the task is to rotate the matrix by 45 degrees and print the matrix. Examples: Input: N =… Read More

Start Your Coding Journey Now!