MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

Trees/binarytreetraversal.c:60–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58 }
59
60 int main() {
61 int data, ch;
62 while (1) {
63 printf("\n1. Insertion\n2. Pre-order\n");
64 printf("3. Post-order\n4. In-order\n");
65 printf("5. Exit\nEnter your choice:");
66 scanf("%d", &ch);
67 switch (ch) {
68 case 1:
69 printf("Enter ur data:");
70 scanf("%d", &data);
71 insertion(&root, data);
72 break;
73 case 2:
74 preOrder(root);
75 break;
76 case 3:
77 postOrder(root);
78 break;
79 case 4:
80 inOrder(root);
81 break;
82 case 5:
83 exit(0);
84 default:
85 printf(" wrong option\n");
86 break;
87 }
88 }
89 return 0;
90 }

Callers

nothing calls this directly

Calls 4

preOrderFunction · 0.85
postOrderFunction · 0.85
inOrderFunction · 0.85
insertionFunction · 0.70

Tested by

no test coverage detected