Frage im Vorstellungsgespräch bei Yelp

use linked list or array for binary search?

Antwort im Vorstellungsgespräch

Anonym

27. Dez. 2013

Arrays are better than linked lists for binary search. Binary search through a sorted array takes O(log n) time, while linked lists take O(n) time (since you have to traverse through the entire linked list).