Pergunta de entrevista da empresa Amazon

Complexity of this algorithm. How to improve the complexity?

Respostas da entrevista

Sigiloso

6 de jun. de 2011

or could be linear time if you're allowed to use a hash table

3

Sigiloso

2 de jun. de 2011

N^2 and can be improved to n logn using binary serach.

1

Sigiloso

9 de jun. de 2011

I'm pretty sure hash table is the answer they were looking for...