## Find the Second Largest Element in a Linked List

Given a Linked list of integer data. The task is to write a program that efficiently finds the second largest element present in the Linked… Read More »

Given a Linked list of integer data. The task is to write a program that efficiently finds the second largest element present in the Linked… Read More »

Given a Queue of integers. The task is to check if consecutive elements in the queue are pairwise consecutive. Examples: Input: 1 2 5 6… Read More »

Given ‘N’ number of sticks of length a1, a2, a3…an. The task is to count the number of squares and rectangles possible. Note: One stick… Read More »

Given an array of N distinct elements, find the minimum number of swaps required to sort the array. Note: The problem is not asking to… Read More »

Given an array of positive integers (may contain duplicates), the task is to find the number of triplets whose product is equal to a given… Read More »

Given N rods of different lengths. The task is to cut all the rods with some maximum integer height ‘h’ such that sum of cut-off… Read More »

Given an array of integers arr[] representing digits of a number. The task is to write a program to generate the largest number possible using… Read More »

Given two arrays H and S. The array H[] contains the length of the hypotenuse and the array S[] contains Area of a right-angled triangle.… Read More »

Java 8 introduced a new method called as parallelSort() in java.util.Arrays Class. It uses Parallel Sorting of array elements Algorithm of parallelSort() 1. The array… Read More »

Given an array of N positive integers and Q queries consisting of an integer K, the task is to print the length of the longest… Read More »

Given an array of N distinct elements and a number val, rearrange the array elements according to the absolute difference with val, i. e., element… Read More »

Given an array of N numbers where a subarray is sorted in descending order and rest of the numbers in the array are in ascending… Read More »

Given a set of strings, find the longest common prefix. Examples: Input: str[] = {geeksforgeeks, geeks, geek, geezer} Output: gee Input: str[] = {apple, ape,… Read More »

Given an array A of N positive integers and a budget B. Your task is to decide the maximum number of elements to be picked… Read More »

Given an array of distinct integers and a range [a, b], the task is to count the number of triplets having a sum in the… Read More »