We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8798bbf commit 2705e92Copy full SHA for 2705e92
Data Structure/BST/binary_serarch_tree.c
@@ -68,6 +68,30 @@ void inOrderPrint(node *rootNode) // InOrder Traversal (left-root-right)
68
inOrderPrint(rootNode->rightChild);
69
}
70
71
+void preOrderPrint(node *rootNode) // PreOrder Traversal (root-left-right)
72
+{
73
+ if(rootNode==NULL)
74
+ return;
75
+
76
+ printf("%d ", rootNode->number);
77
78
+ preOrderPrint(rootNode->leftChild);
79
80
+ preOrderPrint(rootNode->rightChild);
81
+}
82
83
+void postOrderPrint(node *rootNode) // PostOrder Traversal (left-right-root)
84
85
86
87
88
+ postOrderPrint(rootNode->leftChild);
89
90
+ postOrderPrint(rootNode->rightChild);
91
92
93
94
95
node* searchOnTree(int value)
96
{
97
node* currentNode = root;
0 commit comments