Class Treap implemented in C++

This project was made for Data Structures and Algorithms on the 3rd semester of my course "Computer science".

The topic of this project is to create a C++ class representing a Treap - Balanced Binary tree, which needs to be balanced meaning the average height of the tree needs to be logarithm(n), where n is the number of knots in the tree itself. What exactly is a Treap? After any sequence of insertions and deletions of knots, the shape of the tree is a random variable with the same probability distribution as a random binary tree. Moreover, its height is proportional to the logarithm of the number of knots, so that each search, insertion, or deletion operation takes logarithmic time to perform. The main thing that distincs a Treap from a normal Binary tree is the rotation it makes when inserting or deleting a knot, bellow is an example of Treap rotations.

treap rotation example

Visit my github to find out more about the implementation itself: github.com/smajic07/Strukture-Stablo
Find out more about Treaps:
wiki/Treap