Q. What is the main advantage of using a linked list over an array?
-
A.
Faster access time
-
B.
Dynamic size
-
C.
Better memory locality
-
D.
Easier to sort
Solution
Linked lists can grow and shrink in size dynamically, unlike arrays which have a fixed size.
Correct Answer:
B
— Dynamic size
Learn More →
Q. Which of the following operations can be performed in O(1) time on a linked list?
-
A.
Insertion at the end
-
B.
Deletion from the beginning
-
C.
Searching for an element
-
D.
Traversal
Solution
Deletion from the beginning of a linked list can be done in O(1) time as it only requires updating the head pointer.
Correct Answer:
B
— Deletion from the beginning
Learn More →
Showing 1 to 2 of 2 (1 Pages)