Professional Documents
Culture Documents
Practical-8: AIM:-Program To Illustrate The Implementation of Different Operations On A Binary Search Tree
Practical-8: AIM:-Program To Illustrate The Implementation of Different Operations On A Binary Search Tree
Practical-8: AIM:-Program To Illustrate The Implementation of Different Operations On A Binary Search Tree
#include <iostream>
using namespace std;
struct Node
{
int data;
struct Node* left, *right;
Node(int data)
{
this->data = data;
left = right = NULL;
}
};
printPostorder(node->left);
printPostorder(node->right);
printInorder(node->left);
printInorder(node->right);
}
printPreorder(node->left);
printPreorder(node->right);
}
int main( )
{
struct Node *root = new Node(60);
root->left = new Node(45);
root->right = new Node(73);
root->left->left = new Node(12);
return 0;
}
OUTPUT