1.

What kind of linked list is best to answer questions like “What is the item at position n?”(a) Singly linked list(b) Doubly linked list(c) Circular linked list(d) Array implementation of linked listMy question is from Singly Linked List Operations in section Abstract Data Types of Data Structures & Algorithms II had been asked this question in an online interview.

Answer»

Right option is (d) Array implementation of linked LIST

To explain: Arrays PROVIDE random access to elements by providing the index VALUE within square brackets. In the linked list, we need to traverse through each element until we reach the nth position. Time taken to access an element represented in arrays is less than the singly, doubly and circular linked LISTS. Thus, array implementation is USED to access the item at the position n.



Discussion

No Comment Found

Related InterviewSolutions