## Sort prime numbers of an array in descending order

Given an array of integers ‘arr’, the task is to sort all the prime numbers from the array in descending order in their relative positions… Read More »

## Minimum number of towers required such that every house is in the range of at least one tower

Given a map of the city and the network range, the task is to determine the minimum number of the tower so that every house… Read More »

## Count triplets in a sorted doubly linked list whose product is equal to a given value x

Given a sorted doubly linked list of distinct nodes(no two nodes have the same data) and a value x. The task is to count the… Read More »

## Largest element in the array that is repeated exactly k times

Given an array of integers and an integer ‘k’, the task is to find the largest element from the array that is repeated exactly ‘k’… Read More »

## Check if the characters of a given string are in alphabetical order

Given a string ‘s’, the task is to find if the characters of the string are in alphabetical order. The string contains only lowercase characters.… Read More »

## Sort only non-prime numbers of an array in increasing order

Given an array of N integers. The task is to print the sorted array such that all numbers that are prime stay in the same… Read More »

## Product of non-repeating (distinct) elements in an Array

Given an integer array with duplicate elements. The task is to find the product of all distinct elements in the given array. Examples: Input :… Read More »

## Check if it is possible to sort the array after rotating it

Given an array of size N, the task is to determine whether its possible to sort the array or not by just one shuffle. In… Read More »

## Find the top K items with the highest value

Given a list of items and their values. The task is to find top k items with the highest value. It is possible that two… Read More »

## Check if it is possible to rearrange rectangles in a non-ascending order of breadths

Given n number of rectangles with it’s L-length and B-Breadth. We can turn any rectangle by 90 degrees. In other words, after turning them, the… Read More »

## Quotient – Remainder Sort

Quotient – Remainder Sort is a non-comparison based sorting algorithm. Steps to perform Quotient – Remainder sort as described below : Find MIN and MAX… Read More »

## Minimum increment in the sides required to get non-negative area of a triangle

Given three sides of the triangle, find the minimum increase in the length of the side of the triangle to make the area of the… Read More »

## Sort Linked List containing values from 1 to N

Given a linked list of size N containing all values from 1 to N. The task is to sort the linked list in increasing order.… Read More »

## Check if a Linked List is Pairwise Sorted

Given a linked list. The task is to check if the linked list is pairwise sorted or not. A Linked List is considered pairwise sorted… Read More »

## Sort an array of pairs using Java Pair and Comparator

Given an array of pairs of integers. The task is to sort the array with respect to second element of the pair. Examples: Input: [(1,… Read More »