+1 vote
in Data Structures & Algorithms I by (110k points)
Which of the following points is/are not true about Linked List data structure when it is compared with an array?

(a) Arrays have better cache locality that can make them better in terms of performance

(b) It is easy to insert and delete elements in Linked List

(c) Random access is not allowed in a typical implementation of Linked Lists

(d) Access of elements in linked list takes less time than compared to arrays

Query is from Singly Linked List Operations topic in chapter Abstract Data Types of Data Structures & Algorithms I

I have been asked this question in a job interview.

1 Answer

+1 vote
by (412k points)
selected by
 
Best answer
Right option is (d) Access of elements in linked list takes less time than compared to arrays

Easy explanation - To access an element in a linked list, we need to traverse every element until we reach the desired element. This will take more time than arrays as arrays provide random access to its elements.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...