## Sort elements by frequency | Set 5 (using Java Map)

Given an integer array, sort the array according to the frequency of elements in decreasing order, if frequency of two elements are same then sort… Read More »

- Count distinct elements in an array
- Print the nodes of binary tree as they become the leaf node
- Rearrange Odd and Even values in Alternate Fashion in Ascending Order
- Sort the array of strings according to alphabetical order defined by another string
- Merge K sorted arrays | Set 3 ( Using Divide and Conquer Approach )
- Ternary Search
- Number of pairs whose sum is a power of 2
- Amazon Internship Interview Experience
- k-th missing element in an unsorted array
- Nagarro Interview Experience Off-campus
- Merge K sorted arrays of different sizes | ( Divide and Conquer Approach )
- Check if array can be sorted with one swap
- Smallest subarray containing minimum and maximum values
- Find closest value for every element in array
- Sort the array in a given index range
- Maximum sum by picking elements from two arrays in order
- Sort an array of string of dates in ascending order
- Split the array elements into strictly increasing and decreasing sequence
- Python | Sort list of list by specified index
- Array element with minimum sum of absolute differences
- Comparison among Bubble Sort, Selection Sort and Insertion Sort
- Average of remaining elements after removing K largest and K smallest elements from array
- Find the minimum number of rectangles left after inserting one into another
- Delete odd and even numbers at alternate step such that sum of remaining elements is minimized
- Iterative selection sort for linked list
- Minimum operations to make frequency of all characters equal K
- Make palindromic string non-palindromic by rearranging its letters
- Check if words are sorted according to new order of alphabets
- Minimum operations of given type to make all elements of a matrix equal
- Leftmost and rightmost indices of the maximum and the minimum element of an array

Given an integer array, sort the array according to the frequency of elements in decreasing order, if frequency of two elements are same then sort… Read More »

Given two arrays A and B of positive integers of the same size N. The task is to find the maximum sum of products of… Read More »

A sorting algorithm is said to be stable if it maintains the relative order of records in the case of equality of keys. Input :… Read More »

In this sorting algorithm, Hash Function f is used with the property of Order Preserving Function which states that if . Hash Function: f(x) =… Read More »

Given an array, we need to find the sum of elements of an array after changing the element as arr[i] will become abs(arr[i]-x) where x… Read More »

Given N points in K dimensional space where, and . The task is to determine the point such that the sum of Manhattan distances from… Read More »

Given N ranges and Q queries consisting of numbers. Every range consists of L and R. The task is to check if the given number… Read More »

Prerequisite :Merge Sort and Quick Sort Quick sort is an internal algorithm which is based on divide and conquer strategy. In this: The array of… Read More »

Write a function to implement quicksort algorithm that will work for all types of data i.e ints, floats, chars etc. It should accept all types… Read More »

Given two lists that contains cost prices CP[] and selling prices SP[] of products respectively. The task is to maximize the profit by selling at-most… Read More »

Given an array of size n, arrange the first k elements of the array in ascending order and the remaining n-k elements in descending order.… Read More »

Given an array of distinct integers(considering only positive numbers) and a number ‘m’, find the number of triplets with the product equal to ‘m’. Examples:… Read More »

Given an array arr that has numbers appearing twice or once. The task is to identify numbers that occurred only once in the array. Note:… 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 an array of n elements, where each element is at most k away from its target position, devise an algorithm that sorts in O(n… Read More »