Skip to content

Commit

Permalink
docs: clarify more about the binary heap (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
billonahill authored Dec 29, 2024
1 parent b7cd772 commit 0a91335
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mini-lsm-book/src/week1-02-merge-iterator.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ src/iterators/merge_iterator.rs

Now that you have multiple memtables and you will create multiple memtable iterators. You will need to merge the results from the memtables and return the latest version of each key to the user.

`MergeIterator` maintains a binary heap internally. Note that you will need to handle errors (i.e., when an iterator is not valid) and ensure that the latest version of a key-value pair comes out.
`MergeIterator` maintains a binary heap internally. You'll see that the ordering of the binary heap is such that the iterator with the lowest head key value is first. When multiple iterators have the same head key value, the newest one is first. Note that you will need to handle errors (i.e., when an iterator is not valid) and ensure that the latest version of a key-value pair comes out.

For example, if we have the following data:

Expand Down

0 comments on commit 0a91335

Please sign in to comment.