DEV Community

Discussion on: Computer Science and fighting to learn AVL Trees

Collapse
 
schusterbraun profile image
Schuster Braun

Totally agree, thanks for taking the time for great feedback. I alluded to it in the post but never addressed it. There are a couple of ways of determining height and balance factor. One way that I found, like you said is to maintain height references in the nodes. This overly complicated rotation code for me. The first code example is one example of a rotation that maintains a height reference.