Explanation:
Arrays provide random access to elements. This means you can directly access any element by its index in constant time (O(1)).
Linked lists provide sequential access to elements. To access a specific element, you need to traverse the list from the beginning, one node at a time. This takes linear time (O(n)), where n is the number of elements in the list.
Therefore, accessing elements in a linked list is generally slower than in an array.
The other options are true:
a) Random access is not allowed in a typical implementation of Linked Lists: This is correct.
c) Arrays have better cache locality that can make them better in terms of performance: This is true due to the way arrays store elements contiguously in memory.
d) It is easy to insert and delete elements in Linked List: This is generally true, especially when compared to arrays, where shifting elements might be required.
If you think there is any confusion in the given MCQs, you can comment below.
docmcqs.com is Pakistan's No.1 online platform for preparing for all types of exams including PPSC, FPSC, KPSC, SPSC, Ministry of Defence, and for one-paper MCQs. This includes Pedagogy MCQs, general knowledge MCQs, current affairs MCQs, and much more.