4 Comments
User's avatar
Anup Aglawe's avatar

Code for insert looks incorrect to me, root should update regardless of the condition.

Franco Fernando's avatar

You're right; the indentation was incorrect. Thanks, Anup.

Alex Pliutau's avatar

Thanks! Here is a very simple Go implementation - https://gist.github.com/plutov/0a36aab241bb687505e80cdf3e555f30

Franco Fernando's avatar

Interesting, thanks for sharing!