Skip to content

Commit

Permalink
Add table with performance of operations
Browse files Browse the repository at this point in the history
  • Loading branch information
AquaGeek committed Jul 16, 2021
1 parent 26d786a commit 3f04122
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Documentation/Heap.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ for val in heap.descending {

### Performance

| Operation | Complexity |
--------------------------
| Insert | O(log n) |
| Get smallest element | O(1) |
| Get largest element | O(1) |
| Remove smallest element | O(log n) |
| Remove largest element | O(log n) |

In all of the above, `n` is the number of elements in the heap.

## Implementation Details

The implementation is based off [Atkinson et al. Min-Max Heaps and Generalized Priority Queues (1986)](http://akira.ruc.dk/~keld/teaching/algoritmedesign_f03/Artikler/02/Atkinson86.pdf).
Expand Down

0 comments on commit 3f04122

Please sign in to comment.