Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with height calculation #1384

Open
shrivalidutt opened this issue Oct 1, 2024 · 0 comments
Open

Issues with height calculation #1384

shrivalidutt opened this issue Oct 1, 2024 · 0 comments

Comments

@shrivalidutt
Copy link

Logical Errors:

The height calculation during rotations is incorrect. The height should be updated after the rotations, but it’s using the old height values.
The insertion logic does not account for duplicate values. In an AVL tree, typically duplicates are either not allowed or handled in a specific way.
Performance Issues:

The height calculation can be optimized by maintaining the height in the node itself during insertion instead of recalculating it every time.
The populate and populatedSorted methods can be more efficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant