4 ms·
Wow thanks for reading my page and looking at the examples. I appreciate your time. There's a few bugs in that code. Sorry for presenting something that obviou
by samsquire 4y ago
Wow thanks for reading my page and looking at the examples. I appreciate your time.
There's a few bugs in that code. Sorry for presenting something that obviously wasn't ready. I didn't use location when I insert into that position in the btree. And the node spliting code has an error.
And thanks for reformatting the code.
It's a very rough design. The critical insight over many algorithms is hidden in one character or line. Such as a strategic -1 or +1 or pattern of recursion that means it becomes understandable.
I find when writing code the structure of the code is more important than the calculation or addition or subtraction. Which is surprising because computers are calculators. The structure of traversal, laying out data in memory and structure of the jumping around instructions in memory is harder than the core insight of a division, or subtraction or addition or append or +1 or if statement here or there.
When I write recursive code I often want to refer to outer context of an outer recursion. So that's the meaning of the "deepest"
- Jtsummers 4y agoYou may be interested in things like Strand and the work on parallel Prologs which have a similar "let the computer system sort out the proper execution order". This wouldn't satisfy your syntax desire (Algol family) but may help develop your understanding of the problem domain. A discussion last year: https://news.ycombinator.com/item?id=26948351 https://news.ycombinator.com/item?id=26948351 (wow, 18 months since that discussion, seemed more recent in my memory)