Pergunta de entrevista da empresa Amazon

What is the fast sorting algorithm and why?

Respostas da entrevista

Sigiloso

31 de jan. de 2011

quicksort or mergesort

Sigiloso

1 de fev. de 2011

Also, heapsort, which requires less space than mergesort but has same average case time

Sigiloso

11 de fev. de 2011

Its not quick or merge sort.. It is radix sort its O(n) where as both quick and merge take O(nlogn)

Sigiloso

24 de fev. de 2011

It's kind of a trick question :| It depends on how the data is currently represented, how much space you can allocate, how many parameters are being sorted, etc. You need to know more about the data before you can give the best algorithm, there is no one-size-fits-all.