## Merge k sorted arrays | Set 1

Given k sorted arrays of size n each, merge them and print the sorted output. Example: Input: k = 3, n = 4 arr[][] =… Read More »

- Find k closest numbers in an unsorted array
- Building Heap from Array
- Insertion and Deletion in Heaps
- Find m-th smallest value in k sorted arrays
- Find the smallest positive number missing from an unsorted array : Hashing Implementation
- Find the shortest distance between any pair of two different good nodes
- Rearrange numbers in an array such that no two adjacent numbers are same
- Uniform-Cost Search (Dijkstra for large Graphs)
- Minimize the sum calculated by repeatedly removing any two elements and inserting their sum to the Array
- TIAA Internship Experience - Pool campus for Internship
- Maximum possible sub-array sum after at most X swaps
- Reduce the array to a single integer with the given operation
- Introduction to Data Structures | 10 most commonly used Data Structures

Given k sorted arrays of size n each, merge them and print the sorted output. Example: Input: k = 3, n = 4 arr[][] =… Read More »

First of all, a very very big thanks to whole team of geeks for geeks. It is because of them only that I was able… Read More »

Heap sort is a comparison based sorting technique based on Binary Heap data structure. It is similar to selection sort where we first find the… Read More »

My Personal Notes arrow_drop_up Save

Design a Data Structure for the following operations. The data structure should be efficient enough to accommodate the operations according to their frequency. 1) findMin()… Read More »

Given N machines. Each machine contains some numbers in sorted form. But the amount of numbers, each machine has is not fixed. Output the numbers… 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 »

Given that integers are read from a data stream. Find median of elements read so for in efficient way. For simplicity assume there are no… Read More »

Consider the following algorithm for building a Heap of an input array A. BUILD-HEAP(A) heapsize := size(A); for i := floor(heapsize/2) downto 1 do HEAPIFY(A,… Read More »

Given a team of N players. How many minimum games are required to find second best player? We can use adversary arguments based on tournament… Read More »

Heap Data Structure is generally taught with Heapsort. Heapsort algorithm has limited uses because Quicksort is better in practice. Nevertheless, the Heap data structure itself… Read More »

Question: Write an efficient program for printing k largest elements in an array. Elements in array can be in any order. For example, if given… Read More »