SE250:lab-8:ssre005

From Marks Wiki
Revision as of 05:20, 3 November 2008 by Mark (Sọ̀rọ̀ | contribs) (1 revision(s))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
int main (){
    // ParseTree* t = mkNode('+', mkNode('1', 0), mkNode('2',0), 0);
    ParseTree* t = mkNode('-', mkNode('a', 0), mkNode('b',0), 0);
    prefix_tree( t );
    ParseTree* x = mkNode('-', mkNode('a', 0), 0);
    printf("\n");
    prefix_tree( x );
    printf("\n");
    ParseTree* lol = mkNode('-', mkNode('-', mkNode('a', 0), mkNode('b',0)), 0);
    prefix_tree( lol );
    return 0;
} 

The first two parse trees were used to work out the order in which the mkNodes should be passed in.