Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
oorrja
GitHub Repository: oorrja/learntosolveit
Path: blob/master/source/python/algorithm_tree2.rst
1241 views
==============
Tree Traversal
==============

Question
--------

Demonstrate In-order, Pre-order and Post-order Tree traversal.

Solution
--------

.. literalinclude:: ../../languages/python/algorithm_tree2.py
   :language: python
   :tab-width: 4

.. runcode:: ../../languages/python/algorithm_tree2.py
   :language: python
   :codesite: ideone

Explanation
===========





.. seealso::

   * :python-suggest-improve:`algorithm_tree2.py`
   * :python-better-explain:`algorithm_tree2.rst`