Sample insertion sequence for a smallish AVL tree. Note that I printed the left side first; if you rotate your head 90 degrees counter-clockwise it will have the correct orientation. insert:10 EQUALHT:10 ---------------------------------------- insert:30 EQUALHT:30 RIGHTHI:10 ---------------------------------------- insert:20 triggers a single rotation to the left EQUALHT:30 EQUALHT:20 EQUALHT:10 ---------------------------------------- insert:25 LEFTHI:30 EQUALHT:25 RIGHTHI:20 EQUALHT:10 ---------------------------------------- insert:27 triggers a left-right double rotation EQUALHT:30 EQUALHT:27 EQUALHT:25 RIGHTHI:20 EQUALHT:10 ---------------------------------------- insert:15 EQUALHT:30 EQUALHT:27 EQUALHT:25 EQUALHT:20 EQUALHT:15 RIGHTHI:10 ---------------------------------------- insert:12 triggers a right-left double rotation EQUALHT:30 EQUALHT:27 EQUALHT:25 EQUALHT:20 EQUALHT:15 EQUALHT:12 EQUALHT:10 ---------------------------------------- insert:21 EQUALHT:30 LEFTHI:27 LEFTHI:25 EQUALHT:21 RIGHTHI:20 EQUALHT:15 EQUALHT:12 EQUALHT:10 ---------------------------------------- insert:23 triggers a left-right double rotation EQUALHT:30 LEFTHI:27 EQUALHT:25 EQUALHT:23 EQUALHT:21 RIGHTHI:20 EQUALHT:15 EQUALHT:12 EQUALHT:10 ---------------------------------------- insert:26 triggers a left-right double rotation EQUALHT:30 EQUALHT:27 EQUALHT:26 EQUALHT:25 LEFTHI:23 EQUALHT:21 RIGHTHI:20 EQUALHT:15 EQUALHT:12 EQUALHT:10 ---------------------------------------- insert:13 EQUALHT:30 EQUALHT:27 EQUALHT:26 EQUALHT:25 LEFTHI:23 EQUALHT:21 EQUALHT:20 LEFTHI:15 EQUALHT:13 RIGHTHI:12 EQUALHT:10 ---------------------------------------- insert:14 triggers a left-right double-rotation EQUALHT:30 EQUALHT:27 EQUALHT:26 EQUALHT:25 LEFTHI:23 EQUALHT:21 EQUALHT:20 EQUALHT:15 EQUALHT:14 EQUALHT:13 RIGHTHI:12 EQUALHT:10 ---------------------------------------- insert:17 triggers a single rotation to the left EQUALHT:30 EQUALHT:27 EQUALHT:26 EQUALHT:25 LEFTHI:23 EQUALHT:21 EQUALHT:20 EQUALHT:17 RIGHTHI:15 EQUALHT:14 EQUALHT:13 EQUALHT:12 EQUALHT:10 ----------------------------------------