Skiplists were introduced by Pugh [60] who also presented a number of applications and extensions of skiplists [59]. Since then they have been studied extensively. Several researchers have done very precise analyses of the expected length and variance of the length of the search path for the th element in a skiplist [45,44,56]. Deterministic versions [53], biased versions [8,26], and self-adjusting versions [12] of skiplists have all been developed. Skiplist implementations have been written for various languages and frameworks and have been used in open-source database systems [69,61]. A variant of skiplists is used in the HP-UX operating system kernel's process management structures [42].

- Show that, with this modification, the expected length of a search path is at most .
- What is the value of that minimizes the preceding expression?
- What is the expected height of the skiplist?
- What is the expected number of nodes in the skiplist?

A finger search implements the operation using a finger, by walking up the list using the finger until reaching a node such that and or and then performing a normal search for starting from . It is possible to prove that the expected number of steps required for a finger search is , where is the number values in between and the value pointed to by the finger.

Implement a subclass of Skiplist called SkiplistWithFinger that implements operations using an internal finger. This subclass stores a finger, which is then used so that every operation is implemented as a finger search. During each operation the finger is updated so that each operation uses, as a starting point, a finger that points to the result of the previous operation.

Hint 1: Every substring is a prefix of some suffix, so it suffices to store all suffixes of the text file.

Hint 2: Any suffix can be represented compactly as a single integer indicating where the suffix begins in the text.

Test your application on some large texts, such as some of the books available at Project Gutenberg [1]. If done correctly, your applications will be very responsive; there should be no noticeable lag between typing keystrokes and seeing the results.

- Explain how removing some edges of a skiplist leads to a structure that looks like a binary tree and is similar to a binary search tree.
- Skiplists and binary search trees each use about the same number of pointers (2 per node). Skiplists make better use of those pointers, though. Explain why.