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

Binary heap implemenation has O(n) complexity instead of O(log n) #249

Open
alefbragin opened this issue Jun 28, 2024 · 0 comments
Open

Comments

@alefbragin
Copy link

https://github.com/solidstate-network/solidstate-solidity/blob/d1ba52d0981e3d1e1feda525dca8dd0c07ea4a00/contracts/data/BinaryHeap.sol#L251C1-L259C6

Heapify procedure is used in every add/remove operations. Heapify has while loop that call another heapify function exactly len/2. It's O(n).

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

2 participants