Robin Hillyard
1 min readMay 17, 2020

--

Nice article and good code. BTW, B-tree is something quite special and definitely not an appropriate abbreviation for a binary tree.

I’m curious why you say that the algorithm will exhaust the stack on large trees. Have you seen this happen? Your algorithms are all tail-recursive so there should be no stack overflows. You can (and probably should) assert that your algorithm is tail-recursive with the @tailrec annotation.

--

--

Robin Hillyard
Robin Hillyard

Written by Robin Hillyard

I’ve been addicted to programming for over 50 years now. I currently teach two classes to graduates at Northeastern University, Boston, USA.

No responses yet