NEW
Font size
WorksheetsDSA (Quiz 1) Arrays and Linked Lists
Total questions: 15
Worksheet time: 11mins
What is an array?
A collection of elements identified by an index.
A single element with multiple values.
A data structure with fixed size and dynamic memory.
A collection of nodes with pointers.
Which of the following operations is fastest in an array?
Insertion at the beginning
Deletion at the end
Accessing an element by index
Insertion at the end
Which of the following is an advantage of using arrays?
Dynamic size
Efficient memory usage
Fast indexing
Easy insertion and deletion
In a singly linked list, each node contains:
Data and a reference to the previous node.
Data and a reference to the next node.
Only data.
Data and references to both previous and next nodes.
What is the main disadvantage of using arrays?
Slow access to elements
Fixed size
Complex implementation
None of the above
What does the following code do in an array? int arr[] = {1, 2, 3, 4, 5}; for (int i = 0; i < 5; i++) { cout << arr[i] << " "; }
Adds elements to the array
Removes elements from the array
Displays elements in the array
Searches for an element in the array
Which of the following best describes a circular linked list?
The last node points to the first node.
Each node points to the next node only.
Each node points to the previous node only.
The first node points to the last node.
In a doubly linked list, each node contains:
Data and a reference to the next node.
Data and references to both previous and next nodes.
Only data.
Data and a reference to the previous node.
Which operation is faster in a linked list than in an array?
Accessing an element by index
Insertion at the beginning
Deletion at the end
Accessing the last element
Which data structure is ideal for implementing undo functionality in applications like text editors?
Array
Linked List
Stack
Queue
Arrays can have dynamic sizes in most programming languages.
True
False
In a singly linked list, the last node points to the first node.
True
False
Arrays allow for random access to elements, while linked lists do not.
True
False
Linked lists are more memory-efficient than arrays because they do not require contiguous memory allocation.
True
False
In an array, the index of the first element is:
0
1
-1
n
