1
void inorder(Node *root){
if(root!=NULL){
    inorder(root->left);
    cout<<root->key<<" ";
    inorder(root->right);    
}

I want to know how is inorder traversal of binary tree is O(n) mathematically? Shouldn't it be T(N) = 2*T(n-1) + const. ?

Shubham Sharma
  • 141
  • 1
  • 9

0 Answers0