Reputation: 1
purely conceptually, how would I insert 21 into this red-black tree?
Upvotes: 0
Views: 150
Reputation: 776
Compare 21 with 25 => it is less => follow to left child
Compare 21 with 15 => it is more => follow to right child
Compare 21 with 22 => it is less => follow to left child
Compare 21 with 20 => it is more => there is no right child so you insert.
You should have
Upvotes: 1