The structure for a tree node would be as follows.
struct node
{
int num;
struct node *ls;
struct node *rs
>
The pointers *ls and *rs point to the structure node. The pointer *ls contains the address of the left son
and rs is the pointer to the right son. If there are no left son and right son, then the pointers would be
NULL.
15.5 TRAVERSING BINARY TREES
As discussed earlier, three parameters are needed for formation of a binary tree. Passing through every
node of the tree is called traversing. Therefore, traversing of a tree means traversing of a
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.