Message from JavaScript discussions

September 2017

— Doesn't IDDFS have a defined traversal order?


Sort of, yes. It enumerates in-order completely, then switches to traversal mode and dequeues a node from the stack (in this case a tightly overlapping tuple of nodes)

— So, it would then not be iddfs if I changed the order

— I could make it more like dfs by using shift to dequeue and push to queue

— While now it's push and pop?

— Although I never use push personally, and I would not use shift either. Instead I leave the array in a sparse state and reassign keys, or keep a cursor location updated

Message permanent page

— Yes more or less

— Shift is slower I believe

— Agreed

— It is not good to change Array size a lot, so having undefined indexes is better

— Huh, makes sense

— Instead I would simply have a cursor increment every traversal, moving down the array as it's value increases

Message permanent page