Jump to content

Backward inorder traversal

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Poor Yorick (talk | contribs) at 09:05, 8 April 2003. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

In Computer science, Backward Inorder traversal is used in Data structures, and specifically, Trees and Binary Trees.

Programs that utilize tree strucutres need to process nodes in a tree (represented as circles in below diagram). Nodes contain information about an object. For now, let's assume each node contains a letter. The arrows indicate a link between nodes.

Backward InOrder Traversal is a type of Tree Traversal algorithm. Backward Inorder is similar to InOrder, except that the right subtree is processed first.

Steps to Backward Inorder Traversal

Given a non-empty tree,

  1. Process the nodes in the right subtree with a recursive call
  2. Process the root
  3. Process the nodes in the left subtree with a recursive call

Given a binary tree PY:

File:TreePY.gif

The order would go F,C,A,E,G,B,D

Compare: Pre-order traversal, post-order traversal, Inorder traversal