Results 1 to 1 of 1
  1. #1
    Googol is offline Member
    Join Date
    Aug 2012
    Posts
    11
    Rep Power
    0

    Default representing trees within parentheses

    I have found many examples on how to represent mathematical expressions as binary trees in parentheses but I cannot find how to translate a tree with just values, say integers, in parentheses format.
    This is a mathematical expression example I was referring to. These examples are abundant, but how do you do this without operators?

    y = m * x + b
    ( = y ( + ( * m x ) b ) )

    (Sorry about all of the periods, I couldn't keep the spacing without them.)
    .....=
    /.......\
    y........+
    ......./.....\
    ......*......b
    ..../...\
    ..m.....x

    How would this expression look as a tree? Are there general rules on how to convert between the two representations?
    ( ( ( 3 7 ) 2 8 ) ( 9 7 ) 5 0 )
    Last edited by Googol; 10-20-2012 at 01:17 AM.

Similar Threads

  1. It keeps trying to get me to close parentheses...
    By MrPosotive in forum New To Java
    Replies: 2
    Last Post: 09-24-2012, 07:54 AM
  2. representing a seat plan graphically
    By bitzz in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 08-29-2011, 09:21 AM
  3. The increment operator with parentheses
    By 357mag in forum New To Java
    Replies: 2
    Last Post: 07-03-2011, 07:58 PM
  4. matching parentheses stack
    By msa0127a in forum New To Java
    Replies: 9
    Last Post: 10-05-2010, 10:37 PM
  5. Representing ERD with symbols
    By vivvy in forum JDBC
    Replies: 1
    Last Post: 02-17-2010, 05:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •