@@ -23,19 +23,27 @@ First, choose your data structure:
23
23
with automatic rebalancing after each insertion or deletion.
24
24
The height is guaranteed to be logarithmic in the number of nodes.
25
25
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).
26
29
27
30
### Commands
28
31
29
32
Next, enter commands into the text box in the top left.
30
33
You can enter one of the following commands:
31
34
32
35
* ` 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.)
34
38
* ` a key ` /` add key ` /` i key ` /` ins key ` /` insert key ` :
35
39
Insert the given key (if it doesn't exist).
36
40
* ` d key ` /` del key ` /` delete key ` /` rem key ` /` remove key ` :
37
41
Delete the given key (if it exists).
38
42
43
+ BST/AVL-only operations:
44
+
45
+ * ` f key ` /` find key ` : Perform binary search to find the given key.
46
+
39
47
BST-only operations:
40
48
41
49
* ` ai key ` /` avlins key ` /` aa key ` /` avladd key ` : Insert the given key
@@ -53,6 +61,11 @@ BST-only operations:
53
61
* ` l key ` /` left key ` /` rotl key ` /` rotleft key ` /` rotatel key ` /` rotateleft key ` :
54
62
Rotate-left the node containing the given key and its right child.
55
63
64
+ Heap-only operations:
65
+
66
+ * ` dm ` /` dmax ` /` delm ` /` delmax ` /` deletemax ` /` rm ` /` remm ` /` rmax ` /` remmax ` /` removemax ` :
67
+ Delete the maximum key (the root).
68
+
56
69
Each ` key ` can be an ** integer** or a ** Pokémon name** (up to Generation VIII).
57
70
58
71
* 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).
61
74
we match the Pokémon with a name prefix of the smallest possible edit distance.
62
75
* If you enter an integer outside the range [ 1, 905]
63
76
(including zero or negative integers),
64
- it gets treated as that integer,
77
+ the key gets treated as that integer,
65
78
but drawn as the Pokémon whose National Pokédex number is the same modulo 905.
66
79
67
80
You can also specify multiple keys for one operation, e.g., ` aa 1 2 3 4 ` .
0 commit comments