Skip to content

Commit

Permalink
Generate
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestognw committed Jul 23, 2024
1 parent d3308c4 commit 5b07512
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contracts/utils/structs/Heap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ import {Panic} from "../Panic.sol";
* ```
*
* The structure is ordered so that each node is bigger than its parent. An immediate consequence is that the
* smallest value is the one at the root. This value can be lookup up in constant time (O(1)) at
* highest priority value is the one at the root. This value can be lookup up in constant time (O(1)) at
* `heap.data[heap.data[0].index].value`
*
* The structure is designed to perform the following operations with the corresponding complexities:
*
* * peek (get the smallest value in set): O(1)
* * peek (get the highest priority in set): O(1)
* * insert (insert a value in the set): 0(log(n))
* * pop (remove the smallest value in set): O(log(n))
* * replace (replace the smallest value in set with a new value): O(log(n))
* * pop (remove the highest priority value in set): O(log(n))
* * replace (replace the highest priority value in set with a new value): O(log(n))
* * length (get the number of elements in the set): O(1)
* * clear (remove all elements in the set): O(1)
*/
Expand Down

0 comments on commit 5b07512

Please sign in to comment.