Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //i parametri da passare sono l'albero e due numeri(io ci metto 10 e 10 di solito servono per la visualizzazione)
- void print2DUtil(tree root, int space, int COUNT)
- {
- // Base case
- if (root == NULL)
- return;
- // Increase distance between levels
- space = space + COUNT;
- // Process right child first
- print2DUtil(root->right, space, COUNT);
- // Print current node after space
- // count
- printf("\n");
- for (int i = COUNT; i < space; i++)
- printf(" ");
- printf("%s\n", root->value.cognome);
- // Process left child
- print2DUtil(root->left, space, COUNT);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement