prepare an implementation of splay trees that uses bottom-up splaying and another that uses top-down splaying. perform extensive experimental studies to see which implementation is better in practice, if any.

Respuesta :

Binary Search Tree (BST) operations like search, remove, and insert have an O worst-case time complexity (n). When the tree is skewed, the worst case scenario happens.

In addition to doing the conventional BST search, the search operation in the Splay tree also splays (move a node to the root). If the search is successful, the discovered node is spread and elevated to the position of the new root. Otherwise, the root is splayed and becomes the final node accessed before reaching the NULL.

The node can be accessed in the following situations.

Node is root in 1. Given that the accessed node is already root, we only return the root.

2) Zig: Node is a root child (the node has no grandparent). Node is either a right child of its parent (we execute a right rotation) or a left child of root (we do a right rotation).

To know more about node click here:

https://brainly.com/question/28485562

#SPJ4