Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Postorder traversal of a binary tree
struct NODE
{
struct NODE *left;
int value; /* can take any data type */
struct NODE *right;
};
postorder(struct NODE *curr)
if(curr->left != NULL) postorder(curr->left);
if(curr->right != NULL) postorder(curr->right);
printf("%d", curr->value);
}
In a preorder traversal, first (pre) the root is visited and then the left & right sub- trees are traversed. In a postorder traversal, first the left sub-tree is visited, followed by right sub-tree which is then followed through root. In inorder traversal, first the left sub- tree is visited, followed by root, followed by right sub-tree.
Q. Write down a non recursive algorithm to traverse a binary tree in order. Ans: N on - recursive algorithm to traverse a binary tree in inorder is as
Q . Write down the non-recursive algorithm to traverse a tree in preorder. Ans: T he Non- Recursive algorithm for preorder traversal is written below: Initially i
1. In computer science, a classic problem is how to dynamically store information so as to let for quick look up. This searching problem arises frequently in dictionaries, symbol t
Q. Write down an algorithm to insert a node in between any two nodes in a linked list Ans. Insertion of a the node after the given element of the listis as follows
Consistent Heuristic Function - Graph Search Recall the notions of consistency and admissibility for an A* search heuristic. a. Consider a graph with four nodes S, A, B, C,
Q. Explain the basic concept of the primitive data structures. Ans. The concept of P r i m i t i ve Data
how we will make projects on stack in c?
5. Implement a stack (write pseudo-code for STACK-EMPTY, PUSH, and POP) using a singly linked list L. The operations PUSH and POP should still take O(1) time.
For the Oscillating sort to be applied, it is necessary for the tapes to be readable in both directions and able to be quickly reversed. The oscillating sort is superior to the po
A telephone directory having n = 10 records and Name field as key. Let us assume that the names are stored in array 'm' i.e. m(0) to m(9) and the search has to be made for name "X"
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd