# Tag Archives: Sorting Quiz

## Check if Queue Elements are pairwise consecutive | Set-2

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 »

## Possible number of Rectangle and Squares with the given set of elements

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 »

## Minimum number of swaps required to sort an array | Set 2

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 »

## Count number of triplets with product equal to given number with duplicates allowed

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 »

## Cut all the rods with some length such that the sum of cut-off length is maximized

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 »

## Find the largest number that can be formed with the given digits

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 »

## Number of possible pairs of Hypotenuse and Area to form right angled triangle

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 | Arrays parallelSort() method with Examples

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 »

## Longest subsequence whose average is less than K

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 »

## Python | Sort an array according to absolute difference

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 »

## Sort an array where a subarray of a sorted array is in reverse order

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 »

## Longest Common Prefix Matching | Set-6

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 »

## Sudo Placement | Placement Tour

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 »

## Count number of triplets in an array having sum in the range [a, b]

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 »

## Check whether an array can be fit into another array rearranging the elements in the array

Given two arrays A and B of same size N. Check whether array A can be fit into array B. An array is said to… Read More »