I have written the code exactly same as it was in the video, but not getting the output

let me check !! …

@harshulgarg21, you are doing cin>>root , and cout<<root; (prateek bhaiya, must have overloaded the operators)
but you have’nt overloaded the operator cin and cout to work with node* values
so it will give you error , so either overload cin and cout or make a function like buildTree(node* root) and printTree(node* root) for input of tree and printing