NEW
Font size
WorksheetsLinear Data Structures Quiz
Total questions: 40
Worksheet time: 20mins
What is a linear data structure?
A structure where elements are connected sequentially
A structure where elements are connected hierarchically
A structure where elements are connected randomly
None of the above
Which sorting algorithm works by repeatedly selecting the smallest element?
Selection Sort
Insertion Sort
Quick Sort
Bubble Sort
What is the time complexity of accessing an element in an array by index?
O(1)
O(n)
O(log n)
O(n^2)
Which of the following operations is performed in O(1) time in a stack?
Push
Pop
Both
None
The number of passes required in Bubble Sort for an array of n elements is:
n
n - 1
n / 2
n + 1
Which data structure works on the principle of LIFO?
Stack
Queue
Array
Linked List
What is the time complexity of searching in a linked list?
O(1)
O(n)
O(log n)
O(n^2)
Which of the following is not a linear data structure?
Array
Stack
Graph
Queue
Which operation is not possible in a singly linked list?
Traversing forward
Traversing backward
Insertion at the end
Deletion from the start
In a stack, what happens when an attempt is made to pop an element from an empty stack?
Overflow
Underflow
Garbage value is returned
None of the above
Which operation is not performed in a queue?
Enqueue
Dequeue
Peek
Push
In a linked list, the header node:
Stores data only
Points to the next node only
Contains information like list length or metadata
Is always NULL
Which data structure is more suitable for implementing recursion?
Stack
Queue
Array
Linked List
Which of the following is true about a singly linked list?
It can only be traversed in one direction.
It can only be traversed in two directions.
Both traversal directions are possible.
None of the above.
What is the time complexity of deleting the head node in a singly linked list?
O(1)
O(n)
O(log n)
O(n^2)
In a queue, which operation is performed at the front?
Enqueue
Dequeue
Peek
None of the above
What is the output of the following operations on a stack? Operations: push(10), push(20), pop(), push(30), pop()
10 remains in the stack
20 remains in the stack
Stack is empty
30 remains in the stack
Which of the following applications uses a queue?
Undo operation in text editors
Resource scheduling in operating systems
Depth-first search
None of the above
Which operation in a stack returns the top element without removing it?
Pop
Push
Peek
Enqueue
What is the time complexity of insertion at the end of an array?
O(1)
O(n)
O(log n)
O(n^2)
What is the minimum number of nodes required to create a circular linked list?
0
1
2
3
Which of the following is a disadvantage of using an array to implement a stack?
Fixed size
Easy to implement
Efficient access
None of the above
Which data structure is used to solve the 'Tower of Hanoi' problem?
Queue
Stack
Array
Linked List
How is an element inserted in a priority queue?
Based on priority
At the front
At the rear
Randomly
What is the condition for an empty queue in a circular queue?
FRONT = REAR
FRONT = -1
REAR = size - 1
Both a and b
What happens when an element is added to a full queue?
Overflow
Underflow
Garbage value is added
None of the above
Which of the following is true about arrays?
They are fixed in size.
They can grow dynamically.
They are implemented as linked structures.
None of the above.
What is the maximum number of comparisons required to search for an element in a sorted array using binary search, where the array has n elements?
n
log n
⌈log₂ n⌉
n²
What is the amortized time complexity of the enqueue operation in a dynamic array implementation of a queue?
O(1)
O(n)
O(log n)
O(n²)
Which of the following scenarios can lead to an infinite loop when traversing a circular linked list?
The list is empty.
There is no head pointer.
There is no proper termination condition.
The list contains duplicate values.
The time-space trade-off means:
Time increases with memory
More memory can reduce computation time
Time and space are unrelated
Reducing time always reduces memory
What is the primary purpose of a stack data structure?
To store elements in a linear order
To implement priority scheduling
To allow random access to elements
To manage function calls and recursion
Which of the following operations can be performed on a deque?
Enqueue at both ends
Dequeue from both ends
Both
None
What is the time complexity of searching for an element in an unsorted array?
O(n log n)
O(1)
O(log n)
O(n)
What is a sparse matrix?
A matrix with most elements being non-zero
A matrix where most elements are zero
A matrix with an equal number of zero and non-zero elements
A matrix with only one row or one column
What is the primary disadvantage of using a linked list over an array?
Fixed size
Faster access time
None of the above
More memory overhead
What is the time complexity of inserting an element at the end of a singly linked list?
O(1)
O(n)
O(log n)
O(n²)
Which of the following is a characteristic of a doubly linked list?
It does not allow insertion at the beginning
It uses less memory than a singly linked list
It can be traversed in both directions
Each node has only one pointer
What is the primary function of the 'enqueue' operation in a queue?
To remove an element from the front
To add an element to the back
To check the front element
To clear the queue
The term “Asymptotic Notation” is used to:
Compare algorithms’ growth rates for large inputs
Measure the exact running time of an algorithm
Measure memory consumption
Represent constant time operations
