Title Construct a preorder traversal function
Catalog Type SLCItem
Persistent ID https://acos.cs.vt.edu/html/jsparsons/jsparsons-python/ps_python_tree_preorder_traversal
Platform Name jsParsons
Features
Description Construct a preorder traversal function that recursively traverse a tree from root node, left node and right node. We store the traversed tree in a list called res=[]. The traversal function is inside of the tree class. Consider the tree class has been predefined.
Keywords
Author Kamil Akhuseyinoglu
Institution University of Pittsburgh
Iframe URL https://acos.cs.vt.edu/html/jsparsons/jsparsons-python/ps_python_tree_preorder_traversal
Protocol SPLICE
Protocol URL
License MIT
Programming Language Python
Natural Language en

Preview

SPLICE Output