Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

How to re4ad a Tree

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
pythagorasmk
Posts: 148
Joined: 2015-01-18 03:40
Been thanked: 2 times

How to re4ad a Tree

#1 Post by pythagorasmk »

I have Tree in leftmost-child right-sibling representation. Structure for defining the Three is:
typedef struct Node *pNode;
struct Node {
int label;
pNode parrent, left_most_child, right_sibling;
};

The tree is represented with the pointer of the type pNode. I want function readTree which will read the label, number of sub nodes, for each node from the user from console and will construct the tree, and afterr that it will return pointer to the tree. The form of the function should be:

pNode readTree(void)
{
...
}

Thanks

Post Reply