My assignment is to create an AVL Tree from a sorted array list of values in O(n) time where n is the number of values
I have been working on this but I cannot get O(n) time, the best I can get is O(nlog(n))
My problem is that every time a node that causes the tree to be unbalanced is inserted, I have to do another loop to find the node that is unbalanced and apply rotation(s) to balance the tree again.
Any help is greatly appreciated, thanks!