PacktPublishing / Learning-JavaScript-Data-Structures-and-Algorithms-Third-Edition

Learning JavaScript Data Structures and Algorithms (Third Edition), published by Packt
MIT License
1.05k stars 428 forks source link

This condition is unnecessary? #13

Open hefeng6500 opened 2 years ago

hefeng6500 commented 2 years ago

https://github.com/PacktPublishing/Learning-JavaScript-Data-Structures-and-Algorithms-Third-Edition/blob/520e02f041966400fa957bc1a3317b2dc9db4a96/LearningJavaScriptDataStructuresandAlgorithmsThirdEdition_Code/src/js/data-structures/avl-tree.js#L135

Dear loiane.

I think this line is unnecessary, when the node is balanced, it not need to be rotate. it will be cause error if rotate bananced node

loiane commented 2 years ago

Thanks for the comment, could you please raise a PR for the fix?