In a generic tree represented by nodes having pointers to parent, siblings, and firs/last children, as in:
class Tnode {
def data
Tnode parent = null
Tnode first_child = null, last_child = null
Tnode prev_sibling = null, next_sibling = null
Tnode(data=null) {
this.data = data
}
}
Is it possible to do an iterative (non-recursive) breadth-first (level-order) traversal without using any additional helper structures such as a queue.
So basically: we can use single node references for backtracking, but not hold collections of nodes. Whether it can be done at all is the theoretical part, but the more practical issue is whether it can be done efficiently without backtracking on large segments.