Talk:AVL tree/C++: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 10:
 
The abbreviated Java and D samples also have the same problem in that they descend the tree to ascertain the depth. You must be careful not to do anything to upset the performance of RotateLeft and RotateRight.[[User:NNcNannara|NNcNannara]] ([[User talk:NNcNannara|talk]]) 12:26, 16 July 2016 (UTC)
 
[https://en.wikipedia.org/wiki/AVL_tree Wikipedia]'s pseudo code updates the balance factor in the RotateLeft and RotateRight functions. Note that they use a few if statements but do not descend the tree. I suppose that this is OK, although the Rosetta Code leaves the task of updating the balance factor to outer layers. The rotation algorithms supplied here are correct and of optimum performance.[[User:NNcNannara|NNcNannara]] ([[User talk:NNcNannara|talk]]) 08:27, 17 July 2016 (UTC)