3 ms·
Eh. I don't think writing a custom stack implementation would be any more difficult and you'd get to scale to the memory of your machine rather than your langua
by jsprogrammer 11y ago
Eh. I don't think writing a custom stack implementation would be any more difficult and you'd get to scale to the memory of your machine rather than your language's runtime.
- lostcolony 11y agoI'd love to see the code for that if you've got it (I have a recursive version in Javascript). Because the recursive one is really simple to read, intuitively grasp what is going on, confirm is correct, test, modify, etc. And rewriting it to use a stack, while possible, feels harder to me to think up, reason about, and no matter how I try comes out uglier. I haven't spent a lot of time on it, mind you (in part because the recursive one hits everything I care about), but I'd love to see one as elegant written iteratively.