Added implementation for self-balancing heap