back

by newusertoday·8y ago·view on hn ↗
while i am not fan of algorithmic interviews every six months or so i come across text book algorithmic problems in my routine work which is nothing fancy just maintaining legacy code.Recently there was a library given by one of the big four's which had to be integrated into our system. It was working fine on pc but the moment it was brought into embedded system it started corrupting the stack, turned out that it was constructing the tree via recursive call which was blowing up the stack. We had to convert it from DFS to BFS to get it working. So i would certainly not discount value of having good knowledge of algorithms.
1 comments
you know that you can make any stack-recursive routines use their own stack (dynamically allocated), right? I would have started there...
yes, i do :) that still did not solved the issue as before the intermediate stack could unwind it was already going out of the memory budget.
You can also do DFS without using the stack.