SE250:lab-8:ssre005

From Marks Wiki
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.