Software Engineer Interview Questions

Saturday, 11 January 2014

PreOrder(Recursive)

void preorder(node *T){
if(T){
cout<<T->data<<endl;
preorder(T->left);
preorder(T->right);
}
}
Posted by Vidit at 11:38
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ▼  2014 (12)
    • ▼  January (12)
      • Verify if a given tree T1 a subtree of a binary tr...
      • Binary search on rotated array
      • Permute a string recursively
      • Find height of the element in the tree
      • Find Left Most element at each level in binary tree
      • Print out linked list of elements at each level of...
      • BFS in Binary Tree
      • Find Lowest Common Ancestor in BST
      • Search in BST
      • PostOrder(Recursive)
      • PreOrder(Recursive)
      • Inorder Traversal(Recursive)

About Me

Vidit
View my complete profile
Vidit Aggarwal 2014. Awesome Inc. theme. Powered by Blogger.