Skip to content

Commit 920a9c3

Browse files
committed
Document heaps and build
1 parent cadfcfb commit 920a9c3

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,27 @@ First, choose your data structure:
2323
with automatic rebalancing after each insertion or deletion.
2424
The height is guaranteed to be logarithmic in the number of nodes.
2525
This mode forbids manual rotation.
26+
* **Max Heap**:
27+
[Binary heap](https://en.wikipedia.org/wiki/Heap_(data_structure))
28+
via a complete binary tree (of logarithmic height).
2629

2730
### Commands
2831

2932
Next, enter commands into the text box in the top left.
3033
You can enter one of the following commands:
3134

3235
* `clear`: Reset the tree to be empty.
33-
* `f key`/`find key`: Perform binary search to find the given key.
36+
* `b key key ...`/`build key key ...`: Build new structure with the given keys.
37+
(Clears all existing keys.)
3438
* `a key`/`add key`/`i key`/`ins key`/`insert key`:
3539
Insert the given key (if it doesn't exist).
3640
* `d key`/`del key`/`delete key`/`rem key`/`remove key`:
3741
Delete the given key (if it exists).
3842

43+
BST/AVL-only operations:
44+
45+
* `f key`/`find key`: Perform binary search to find the given key.
46+
3947
BST-only operations:
4048

4149
* `ai key`/`avlins key`/`aa key`/`avladd key`: Insert the given key
@@ -53,6 +61,11 @@ BST-only operations:
5361
* `l key`/`left key`/`rotl key`/`rotleft key`/`rotatel key`/`rotateleft key`:
5462
Rotate-left the node containing the given key and its right child.
5563

64+
Heap-only operations:
65+
66+
* `dm`/`dmax`/`delm`/`delmax`/`deletemax`/`rm`/`remm`/`rmax`/`remmax`/`removemax`:
67+
Delete the maximum key (the root).
68+
5669
Each `key` can be an **integer** or a **Pokémon name** (up to Generation VIII).
5770

5871
* If you enter a Pokémon name, it gets converted into the corresponding
@@ -61,7 +74,7 @@ Each `key` can be an **integer** or a **Pokémon name** (up to Generation VIII).
6174
we match the Pokémon with a name prefix of the smallest possible edit distance.
6275
* If you enter an integer outside the range [1, 905]
6376
(including zero or negative integers),
64-
it gets treated as that integer,
77+
the key gets treated as that integer,
6578
but drawn as the Pokémon whose National Pokédex number is the same modulo 905.
6679

6780
You can also specify multiple keys for one operation, e.g., `aa 1 2 3 4`.

index.civet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,7 @@ function gui(): void
705705
remove: 'delete'
706706
rem: 'delete'
707707
delmax: 'deletemax'
708+
delm: 'deletemax'
708709
dmax: 'deletemax'
709710
dm: 'deletemax'
710711
remmax: 'deletemax'

0 commit comments

Comments
 (0)