Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5
Because to access any element in a linked list you have to iterate from the front ( or back ) through each element until you find the element you're looking for. Which makes the lookup time O(n). Arrays on the other hand can be accessed anywhere in O(1). You can perform a binary search on a list, but it's just gonna be veeeeeeery slow. :)
9th Mar 2019, 3:29 PM
Dennis
Dennis - avatar