- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Randomized Finger Search Trees in Data Structure

Two randomized alternatives to deterministic search trees are the randomized binary search trees, treaps and the skip lists. Both treaps and skip lists are defined as elegant data structures, where the randomization facilitates simple and efficient update operations.

In this section we explain how both treaps and skip lists can be implemented as efficient finger search trees without changing the data structures. Both data structures support finger searches by consuming expected O(log d) time, where the expectations are taken over the random choices created by the algorithm during the construction of the data structure.

## Skip lists

In a skip list, one can finger search for element a from a node containing the element b by simply continuing the search from this point. Note that if a < b, then search proceeds at backward direction, and if a > b, then search proceeds at forward direction. The backwards case is symmetric to normal search in a skip list, but the forward case is actually more complicated. Normally, search in a skip list is expected to be fast because the sentinel at the start of the list is considered as the tallest node. However, our finger could be associated with a node of height 1. Because of this, we may rarely climb while trying to search; something which never occurs normally. However, even with this complication, we can be able to achieve O(log d) expected search time.

## Treaps

A treap is defined as a randomized binary search tree (BST). Searching in a treap is the similar as searching for an element in any other BST. Treaps however have the property that the expected path length between two elements of distanced is denoted as O(log d). Thus, to finger search from the node containing element b for element a, one can climb the tree from b element until an ancestor of element a is found, at which point normal BST search proceeds as usual manner. While calculating if a node is the ancestor of another is non-trivial, one may augment the tree to support queries of this form to provide expected O(log d) finger search time.

- Related Questions & Answers
- Dynamic Finger Search Trees in Data Structure
- Comparison of Search Trees in Data Structure
- Balanced binary search trees in Data Structure
- Finger Searching in Data Structure
- Static Finger Theorem in Data Structure
- Splay trees in Data Structure
- Solid Trees in Data Structure
- Range Trees in Data Structure
- BSP Trees in Data Structure
- Huffman Trees in Data Structure
- R-trees in Data Structure
- Interval Trees in Data Structure
- Segment Trees in Data Structure
- Tournament Trees, Winner Trees and Loser Trees in Data Structure
- Optimal Lopsided Trees in Data Structure