RedBlackTree.erase

Erases an entry by its key.

Arguments

key
for the entry to erase. If there is no such key, the method has no effect.

Return values

None

Complexity

O(log(size))

Example

"sl/redBlackTree" useFile a:((12 "aaa") (3 "THREE") (56 "fifty-six")) makeRedBlackTree; a [print LF print TRUE] enum 3 a.erase "after erase" print LF print a [print LF print TRUE] enum
Output:
{ key: 3; value: "THREE"; } { key: 12; value: "aaa"; } { key: 56; value: "fifty-six"; } after erase { key: 12; value: "aaa"; } { key: 56; value: "fifty-six"; }