40 Lecture
CS301
Midterm & Final Term Short Notes
Skip List
Skip list is a probabilistic data structure that allows for efficient searching, insertion, and deletion operations on a set of elements. It is a linked list with multiple parallel layers, where each layer contains a subset of the elements from
Important Mcq's
Midterm & Finalterm Prepration
Past papers included
Download PDF
Which of the following data structures is a probabilistic data structure? A) Binary search tree B) AVL tree C) Skip list D) Red-black tree Answer: C) Skip list
In a skip list, what is the maximum number of levels that a node can have? A) 1 B) 2 C) log n D) Unlimited Answer: D) Unlimited
What is the time complexity of searching for an element in a skip list? A) O(n) B) O(log n) C) O(n log n) D) O(1) Answer: B) O(log n)
Which of the following operations cannot be performed on a skip list? A) Insertion B) Deletion C) Searching D) Sorting Answer: D) Sorting
Which of the following is the main advantage of using skip lists over balanced trees? A) Space efficiency B) Time efficiency C) Ease of implementation D) None of the above Answer: C) Ease of implementation
Which of the following is a disadvantage of using skip lists? A) High space complexity B) High time complexity C) Limited applicability D) None of the above Answer: A) High space complexity
In a skip list, what is the probability of a node having k+1 levels, given that it has k levels? A) 1/2 B) 1/4 C) 1/8 D) 1/16 Answer: B) 1/4
What is the worst-case time complexity of insertion in a skip list? A) O(n) B) O(log n) C) O(n log n) D) O(1) Answer: A) O(n)
In a skip list, what is the maximum number of nodes that can be present in a level i, given that there are n total nodes in the skip list? A) n B) n/2 C) n/log n D) log n Answer: B) n/2
Which of the following is a disadvantage of using skip lists over hash tables? A) Lower space complexity B) Higher time complexity C) Lack of support for efficient range queries D) None of the above Answer: C) Lack of support for efficient range queries
Subjective Short Notes
Midterm & Finalterm Prepration
Past papers included
Download PDF
What is a skip list? Answer: A skip list is a probabilistic data structure that allows efficient searching, insertion, and deletion operations in a sorted sequence of elements.
How does a skip list differ from a linked list? Answer: A skip list differs from a linked list in that it allows for logarithmic search time by adding layers of pointers to the underlying linked list.
What is the time complexity of searching in a skip list? Answer: The time complexity of searching in a skip list is O(log n).
What is the advantage of using a skip list over a binary search tree? Answer: The advantage of using a skip list over a binary search tree is that it requires less memory overhead and is simpler to implement.
How is a skip list constructed? Answer: A skip list is constructed by layering multiple levels of nodes on top of a linked list, where each level skips over nodes in the lower levels with a certain probability.
What is the maximum number of levels in a skip list? Answer: The maximum number of levels in a skip list is typically O(log n).
How are nodes inserted into a skip list? Answer: Nodes are inserted into a skip list by first searching for the correct position in the lowest level, then flipping a coin to determine if the node should be promoted to a higher level.
How are nodes removed from a skip list? Answer: Nodes are removed from a skip list by first searching for the node to be removed, then updating the pointers of the surrounding nodes to bypass the node to be removed.
Can a skip list be used to implement a priority queue? Answer: Yes, a skip list can be used to implement a priority queue by maintaining the elements in sorted order.
What is the space complexity of a skip list? Answer: The space complexity of a skip list is O(n log n).