Euler Tour Traversal of Binary Tree

Algorithm:

eulerTour(Node t)
if t ≠ null
    if t is a leaf node
        visit t
    else
        visit t     // on the left
        eulerTour(t.left);
        visit t;    // from below
        eulerTour(t.right);
        visit t;    // on the right

example:

euler tour traversal

visit history: 5 --> 4 --> 2 --> 1 --> 2 --> 3 --> 2 --> 4 --> 5 --> 7 --> 6 --> 7 --> 9 --> 8 --> 9 --> 7 --> 5

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.