1.

What is the time complexity improvement of skip lists from linked lists in insertion and deletion?(a) O(n) to O(logn) where n is number of elements(b) O(n) to O(1) where n is number of elements(c) no change(d) O(n) to O(n^2) where n is number of elementsThis interesting question is from Skip List topic in portion Types of Lists of Data Structures & Algorithms II got this question in homework.

Answer»

The correct CHOICE is (a) O(n) to O(logn) where n is NUMBER of elements

Easy explanation - In Skip list we skip some of the elements by adding more layers. In this the skip list RESEMBLES BALANCED binary search trees. Thus we can change the TIME complexity from O (n) to O (logn)



Discussion

No Comment Found

Related InterviewSolutions