Question: The Assignment This assignment contains two main parts: Part 1 [ 4 0 marks ] - extension of the SSet interface that supports two extra

The Assignment
This assignment contains two main parts:
Part 1[40 marks]- extension of the SSet interface that supports two extra operations
The IndexedSSet interface is an extension of the SSet interface described in the textbook that supports two extra operations
- get (i): return the value at index \( i \), in other words, return the value \( x \) in the set that is larger than exactly \( i \) other elements in the set.
-\(\quad \) spanLength \((x, y)\) : return the number of elements in the set that are between the values \( x \) and \( y \) inclusive (\( x \) is not necessarily smaller than \( y \)).\( x \) and \( y \) are not necessarily in the set.
Currently, there are two identical implementations of the IndexedSSet interface using skiplists included in the assignment: SkippitySlow and SkippityFast. Despite their names, both are slow: each has implementations of get ( i ) and spanLength (\(\mathrm{x},\mathrm{y}\)) that run in \(\Omega(n)\) time, in the worst case.
Modify the SkippityFast implementation so that the get(i) and spanLength(\( x, y \)) operations each run in \(\boldsymbol{O}(\log \boldsymbol{n})\) expected time and none of the other operations (add \((x)\), remove \((x)\), find \((x)\), etc.) have their running-time increased by more than a small constant factor. Note that to achieve this, you will have to modify the implementations of add \((x)\) and remove \((x)\) operations. Other
The Assignment This assignment contains two main

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!