Question 1
Which of the following is a disadvantage of linked lists over arrays?
1
Ease of insertion and deletion
2
More memory usage
3
No memory wastage
4
Dynamic size
Question 2
What is the time complexity of inserting an element at the head of a singly linked list?
1
O(n)
2
O(log n)
3
O(1)
4
O(n log n)
Question 3
How many pointers are required to implement a singly linked list of size n?
1
n + 1
2
2n
3
n - 1
4
n
Question 4
In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is
1
log(2*n) -1
2
log n/2
3
n
4
n log n
Question 5
Let M be a singly linked list. Let N be the pointer to an intermediate node p in the list. What is the worst-case time complexity of the best known algorithm to delete the node N from the list?
1
O(n)
2
O(log n)
3
O(1)
4
O(log(2*n))
Question 6
What is the worst case time complexity of inserting n elements into an empty linked list, if the linked list needs to be maintained in sorted order ?
1
O(n)
2
O(1)
3
O(n^2)
4
O(n log n)
Question 7
Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity?
1
Insertion Sort
2
Merge Sort
3
Heap Sort
4
Quick Sort