Message from JavaScript discussions
September 2017
— My goodness
I think by messing with queue ordering I can make it behave differently... Walk trees in different ways. It would be changing just two operations
— 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
— 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