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!
Q. Write down the non-recursive algorithm to traverse a tree in preorder. Ans:
Q. Write down the non-recursive algorithm to traverse a tree in preorder.
Ans:
The Non- Recursive algorithm for preorder traversal is written below: Initially in the begnining push NULL onto stack and then set PTR=Root. Keep on repeating the following steps until PTR= NULL. 1. Preorder down the left most paths routed at the PTR. 2. Processing each node N on the path and pushing each right child if there is onto the stack.[The traversing will stop when (PTR)=NULL] 3. Backtracking: pop and assign to PTR the top element on stack. If PTR is not equal to NULL then return to step 1 otherwise it exits.
The Non- Recursive algorithm for preorder traversal is written below: Initially in the begnining
push NULL onto stack and then set PTR=Root. Keep on repeating the following steps until PTR= NULL.
1. Preorder down the left most paths routed at the PTR.
2. Processing each node N on the path and pushing each right child if there is onto the stack.[The traversing will stop when (PTR)=NULL]
3. Backtracking: pop and assign to PTR the top element on stack. If PTR is not equal to NULL then return to step 1 otherwise it exits.
Write down any four applications of the queues. Ans. A pp li cation of Queue is given below (i) Queue is
how to calculate complexity of a program
Q. How can we free the memory by using Boundary tag method in the context of Dynamic memory management?
The following DNA sequences are extracted from promoter region of genes which are co-regulated by the same transcription factor (TF). The nucleotide segments capitalized in the giv
As part of an experiment, a school measured heights (in metres) of all its 500 students. Write an algorithm, using a flowchart that inputs the heights of all 500 students and ou
how we can convert a graph into tree
A shop sells books, maps and magazines. Every item is identified by a unique 4 - digit code. All books have a code starting with a 1, all maps have a code which starts with a 2 and
A queue is a particular type of collection or abstract data type in which the entities in the collection are went in order and the principal functions on the collection are the add
Algorithm to find sum of square of a number
Suppose there are exactly five packet switches (Figure 4) between a sending host and a receiving host connected by a virtual circuit line (shown as dotted line in figure 4). The tr
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: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd