Friday, July 31, 2009

C Program Help?

Write a program in ‘C’ language which accepts in order and preorder traversal outputs of a Binary Tree as input and prints the corresponding Binary tree.

C Program Help?
class PrePostVisitor : public Visitor


{


public:


virtual void PreVisit (Object%26amp;) {}


virtual void Visit (Object%26amp;) {}


virtual void PostVisit (Object%26amp;) {}


};





class PreOrder : public PrePostVisitor


{


Visitor%26amp; visitor;


public:


PreOrder (Visitor%26amp; v) : visitor (v)


{}


void PreVisit (Object%26amp; object)


{ visitor.Visit (object); }


};





class InOrder : public PrePostVisitor


{


Visitor%26amp; visitor;


public:


InOrder (Visitor%26amp; v) : visitor (v)


{}


void Visit (Object%26amp; object)


{ visitor.Visit (object); }


};





class PostOrder : public PrePostVisitor


{


Visitor%26amp; visitor;


public:


PostOrder (Visitor%26amp; v) : visitor (v)


{}


void PostVisit (Object%26amp; object)


{ visitor.Visit (object); }


};
Reply:OK, here it is:





void main (int argc, string *argv) {


google (binary_tree);


do (your_own_homework);


}
Reply:Hi!


You wanted me to write a program in ‘C’ language [...].


OK, i did it. It works fine. So i am sure, you will be happy to know that i did all you wanted from me.


BTW, next time be more polite when asking people to do your homework instead of you.
Reply:Ok written the program.... now, did you want help with something? You mention it in the subject of your question, but in the details you only ordered us to write a program. How does this help you? Perhaps you forgot the question?





Or maybe you're just being arrogant and rude....

bridal flowers

No comments:

Post a Comment