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?


Interview Answer

3 Answers


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

Interview Candidate on Jun 1, 2011

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

Anonymous on Jun 5, 2011

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.