Hi, i found bug in delete function in data structure Splay Tree. For example:
6
/ \
5 15
I want delete 15, after splay 15 tree will see:
15
/
6
/
5
In condition (right_tree == nullptr), root save pointer on right element, but after delete - right element is not available.
6
/ \
5 ?
I think need add M->rightChild == nullptr in (right_tree == nullptr) condition and similarly in (right_tree == nullptr).
Hi, i found bug in delete function in data structure Splay Tree. For example: 6 / \ 5 15 I want delete 15, after splay 15 tree will see: 15 / 6 / 5 In condition (right_tree == nullptr), root save pointer on right element, but after delete - right element is not available. 6 / \ 5 ? I think need add M->rightChild == nullptr in (right_tree == nullptr) condition and similarly in (right_tree == nullptr).