Data Structures Trees Question:

Download Job Interview Questions and Answers PDF

What is splay trees?

Data Structures Trees Interview Question
Data Structures Trees Interview Question

Answer:

A splay tree is a self-balancing binary search tree. In this, recently accessed elements are quick to access again

It is useful for implementing caches and garbage collection algorithms.

When we move left going down this path, its called a zig and when we move right, its a zag.

Following are the splaying steps. There are six different splaying steps.
1. Zig Rotation (Right Rotation)
2. Zag Rotation (Left Rotation)
3. Zig-Zag (Zig followed by Zag)
4. Zag-Zig (Zag followed by Zig)
5. Zig-Zig
6. Zag-Zag

Download Data Structures Trees Interview Questions And Answers PDF

Previous QuestionNext Question
What is a B tree?Explain red-black trees?