Domanda di colloquio di Google

Merge k sorted int arrays, each array containing n ints, into 1 array. And give the complexity.

Risposte di colloquio

Anonimo

13 lug 2012

K way merge with heap is a solution. The time complexity is nklog(k)

1

Anonimo

5 lug 2012

Loser Tree is a solution. The time complexity is O(n*k*log(k)).