File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,10 @@ import {StorageSlot} from "../StorageSlot.sol";
1717 * index i is the child of the node at index (i-1)/2 and the parent of nodes at index 2*i+1 and 2*i+2. Each node
1818 * stores an element of the heap.
1919 *
20- * The structure is ordered so that each node is bigger than its parent. An immediate consequence is that the
21- * highest priority value is the one at the root. This value can be looked up in constant time (O(1)) at
22- * `heap.tree[0]`
20+ * The structure is ordered so that, per the comparator, each node has lower priority than its parent; as a
21+ * consequence, the highest-priority value is at the root. This value can be looked up in constant time (O(1)) at
22+ * `heap.tree[0]`. By default, the comparator is `Comparators.lt`, which treats smaller values as higher priority
23+ * (min-heap). Using `Comparators.gt` yields a max-heap.
2324 *
2425 * The structure is designed to perform the following operations with the corresponding complexities:
2526 *
You can’t perform that action at this time.
0 commit comments