Thread: btree structure given postorder and inorder

  1. #1
    romancoat
    Guest

    btree structure given postorder and inorder

    How do you determine the binary tree sequence, given the postorder and inorder sequences?

    Example:
    Postorder: GROLHMTIA
    Inorder: GLROAIHTM

    I need an algorithm that will give me the binary tree structure.

  2. #2
    CS Author and Instructor
    Join Date
    Sep 2002
    Posts
    511

    Wink

    Well , check the Internet and Data Structure books this is a common binary tree homwork problem.

    1. What is a binary tree?

    2. Look at the traversals

    3. draw the tree.

    I can give you some name of books that can help solve the program if you wish,
    Mr. C: Author and Instructor

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Iterative postorder traversal for BST
    By mcha in forum C Programming
    Replies: 6
    Last Post: 02-05-2008, 01:25 AM
  2. Replies: 5
    Last Post: 11-21-2004, 04:39 PM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  4. how to do the preorder N Postorder?? (Pascal)
    By razoblade in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-16-2001, 04:52 AM