Top "Tree-traversal" questions

The process of visiting each node in a tree based on certain criterion.

print level order traversal of binary tree in Zigzag manner

I have to print the nodes of a binary tree using level order traversal but in spiral form i.e …

algorithm binary-tree tree-traversal
how can a breadth-first-search-tree include a cross-edge?

Well, I know that a breadth-first-search-tree of an undirected graph can't have a back edge. But I'm wondering how can …

algorithm tree graph-algorithm breadth-first-search tree-traversal
Jackson json : traversing a json tree node by node

I have numerous text files containing json data and I'm using new ObjectMapper().readTree() method in Jackson json parser to …

java json jackson tree-traversal
Python - Tree traversal question

I have a hard time with tree traversal, and so avoid it like the plague... normally. I have a class …

python algorithm binary-tree tree-traversal
Iterative depth-first tree traversal with pre- and post-visit at each node

Can anyone point me at pseudocode for iterative depth-first tree traversal, where it's possible to do actions on each node …

algorithm tree-traversal
Depth First Traversal on BeautifulSoup Parse Tree

Is there a way to do a DFT on a BeautifulSoup parse tree? I'm trying to do something like starting …

python beautifulsoup tree-traversal
Post-order Graph Traversal?

Given the directed graph below, how did we achieve the post-order traversal? DFS Visiting order in Pre-order traversal: 1 2 5 4 6 3 Visiting order …

algorithm data-structures tree-traversal graph-traversal
Recursive Postorder Traversal to List in Python?

Hello all—I'm a programming newcomer, and have the following very simple code here: def postorder(T): if T != None: …

python list tree tree-traversal
How do I query objects of all children of a node with Django mptt?

I am trying to get the objects of all the children of a given node on Django with django-mppt I …

python django tree-traversal django-mptt mptt
Steepest Ascent Hill Climbing vs Best First Search

I am trying to solve a problem using different algorithms and Steepest Ascent Hill Climbing (SAHC) and Best First Search …

algorithm tree traversal tree-traversal tree-search