Title Construct a preorder traversal function
Catalog Type SLCItem
Persistent ID https://adapt2.sis.pitt.edu/acos/pitt/jsparsons/jsparsons-python/ps?example-id=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 trees
Author Kamil Akhuseyinoglu
Institution University of Pittsburgh
Iframe URL https://adapt2.sis.pitt.edu/acos/pitt/jsparsons/jsparsons-python/ps?example-id=ps_python_tree_preorder_traversal&grp=demo&usr=demo&sid=-1&cid=-1
Protocol PITT
Protocol URL
License MIT
Programming Language Python
Natural Language en

Preview