Amazon Interview Question: Complexity of this algorithm.... | Glassdoor

Interview Question

Software Development Engineer I Interview(Student Candidate) Seattle, WA

Complexity of this algorithm. How to improve the complexity?

Answer

Interview Answer

3 Answers

0

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

Interview Candidate on Jun 1, 2011
2

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

Anonymous on Jun 5, 2011
0

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

Anonymous on Jun 9, 2011

Add Answers or Comments

To comment on this, Sign In or Sign Up.