Find first `k` maximum occurring words in a given set of strings
Given a huge set of words with duplicates present and a positive integer k, find the first k–maximum occurring words in it.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven a huge set of words with duplicates present and a positive integer k, find the first k–maximum occurring words in it.
A Treap data structure is basically a combination of a binary search tree and a heap.
Given a string, find first k non-repeating characters in it by doing only a single traversal of it.
In previous post, we have introduced the heap data structure and covered heapify-up, push, heapify-down and pop operations. This article covers Java implementation of Priority Queue Data Structure (Max Heap and Min heap).
The external merge sort algorithm is used to efficiently sort massive amounts of data when the data being sorted cannot be fit into the main memory (usually RAM) and resides in the slower external memory (usually a HDD).
Given a set of cities and the distance between every pair of cities, the problem is to find the shortest possible route that visits every city exactly once and returns to the starting point.
Given m sorted lists, each containing n elements, print them efficiently in sorted order.
Given M sorted lists of variable length, efficiently compute the smallest range, including at least one element from each list.
Given an array and a positive integer k, find k’th smallest element in the array… We can easily solve this problem in O(n.log(k)) time by using a max-heap.
Given a k–sorted array that is almost sorted such that each of the n elements may be misplaced by no more than k positions from the correct sorted order. Find a space-and-time efficient algorithm to sort the array.
Given an array and positive integer k, find k’th largest element in the array.
Given an array representing a max-heap, in-place convert it into the min-heap in linear time.