The Red-Black Tree is used for high-level sorting of price levels which allows for efficient insertion, deletion and lookup of price levels in the order book. Each
nodeKey
represents a price level. Note that Limits for each price level, which track the linked lists of orders, are stored separately from the tree.RedBlackTree
init
init
insert
insert
remove
remove
get
get
contains
contains
getNextBiggest
getNextBiggest
getNextSmallest
getNextSmallest
assertInvariants
assertInvariants