trekhleb / trekhleb/javascript-algorithms

AVL Tree rotation method is very confusing

Open
#427 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
197k
Forks
31k
PR merge metrics
No merged PRs in 30d

Description

This is about AvlTree.js - rotateLeftLeft, rotateRightRight method
rotateLeftLeft should be call 'caseLeftLeft' or 'rotateRightRight'.
Because base on the image on avi tree readme.md, rotateLeftLeft method is a right-right rotation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with AvlTree.js and compare the rotateLeftLeft and rotateRightRight method names with the AVL rotation diagram in readme.md. Trace references to these methods, then make the naming consistent with the documented rotation cases and verify that the existing AVL behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.