JMU
Tree Traversal
An Introduction


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu


Background
Tree Traversal
Traversing Binary Trees
Traversing Binary Trees (cont.)

Pseudocode for Inorder Traversal

    inOrder(current)
    {
        if (current != null) 
        {
            inOrder(current's left)

	    print(current's data)

	    inOrder(current's right)
        }
    }