MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Choose the correct statement in the below comparison of an array and a linked list?
A
The size of an array is similar to size of linked list is variable.
B
In array, the data elements are stored in continuous memory locations but in linked list, it is non continuous memory locations.
C
Addition, removal of data is tedious in linked list whereas in arrays it is easy.
D
None
Explanation: 

Detailed explanation-1: -1. An array is a grouping of data elements of equivalent data type. A linked list is a group of entities called a node. The node includes two segments: data and address.

Detailed explanation-2: -Arrays allow random access and require less memory per element (do not need space for pointers) while lacking efficiency for insertion/deletion operations and memory allocation. On the contrary, linked lists are dynamic and have faster insertion/deletion time complexities.

Detailed explanation-3: -Which of the following points is/are true about Linked List data structure when it is compared with array? Arrays have better cache locality that can make them better in terms of performance. It is easy to insert and delete elements in Linked List.

Detailed explanation-4: -1) Memory Usage: The memory required by a linked list is more than the memory required by an array, as there is also a pointer field along with the data field in the linked list. The pointer field too requires memory to store the address of the next node.

There is 1 question to complete.