Category Archives: Heap

Binomial Heap

The main application of Binary Heap is as implement priority queue. Binomial Heap is to extension of Binary Heap that provides faster union or merge operation together with other operations provided by Binary Heap.

Connect n ropes with minimum cost

There are given n ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal to sum of their lengths.

Median in a stream of integers (running integers)

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 duplicates. For example, let us consider the stream 5, 15, 1, 3 … After reading 1st element of stream – 5 -> median – 5 After reading 2nd element of… Read More »