Where is the problem in implementing BST in this code
#include <iostream> using namespace std; struct node{ int data; node *left, *right; }; class bst{ public: node *root; bst(){ root = NULL; } void insert(node *, int ); void traversal(node *); }; void bst::traversal(node* cur){ if(cur->left != NULL) traversal(cur->left); cout<<cur->data; if(cur->right != NULL) traversal(cur->right); // if(cur->left != NULL) traversal(cur->left); } void bst::insert(node *cur, int data){ if(cur == NULL){ node *temp = new node; temp->data = data; temp->left = NULL ; temp->right = NULL; cur = temp; } else{ if(data < cur->data) insert(cur->left, data); else insert(cur->right, data); } } int main() { bst a; a.insert(a.root,3); a.insert(a.root,1); a.traversal(a.root); return 0; }