is balanced tree

time complexity is O(n^2)