alexey-ernest / go-hft-orderbook

Golang implementation of a Limit Order Book (LOB) for high frequency trading in crypto exchanges
MIT License
211 stars 56 forks source link

BugFix in redBlackBst implmentation #7

Open aman-1nayak opened 1 year ago

aman-1nayak commented 1 year ago

Scenario: Deletion of the Largest Key

Issue: After largest key deletion all next/pre queries on t.maxC gives nil pointer

What's Happening: When a largest node is removed from the tree due to the deletion operation, the tree is correctly updated. However, the t.maxC node still points to the deleted node, causing all queries of Next or Previous from t.maxC to result in a nil pointer.

alexey-ernest commented 9 months ago

Largest key deletion or smallest key deletion? If it is the case then both methods should be updated accordingly.