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 recursive function to count the number of the nodes in the binary tree.
Ans.
Recursive Function to count no. of Nodes in Binary Tree is written below
The number NUM of nodes in T is 1 greater than the number NULL of nodes in the left subtree of T plus the number NUMR of nodes in the right subtree of the T. Count( LEFT , RIGHT , ROOT , NUM.)
This procedure finds the number NUM of nodes in a binary tree T in memory.
1. If ROOT = NULL, then : Set NUM := 0, & Return.
2. Call COUNT( LEFT , RIGHT , LEFT[ ROOT], NUML).
3. Call COUNT ( LEFT , RIGHT, RIGHT[ ROOT], NUMR).
4. Set NUM := NUML +NUMR+1.
5. Return.
Determine about the Post conditions assertion A post condition is an assertion which should be true at completion of an operation. For instance, a post condition of the squ
The minimum cost spanning tree has broad applications in distinct fields. It represents several complicated real world problems such as: 1. Minimum distance for travelling all o
A company is carrying out a survey by observing traffic at a road junction. Every time a car, bus or lorry passed by road junction it was noted down. 10 000 vehicles were counted d
Krushkal's algorithm uses the concept of forest of trees. At first the forest contains n single node trees (and no edges). At each of the step, we add on one (the cheapest one) edg
i:=1 while(i { x:=x+1; i:=i+1; }
What do we mean by algorithm? What are the characteristics of a good and relevant algorithm? An algorithm is "a step-by-step procedure for finishing some task'' An algorithm c
W h at are the different ways by which we can represent graph? Represent the graph drawn below using those ways. T he d iff e r e nt w a y s by
write an algorithm for stack using array performing the operations as insertion ,deletion , display,isempty,isfull.
An advertising project manager developed the network diagram shown below for a new advertising campagign. In addition, the manager gathered the time information for each activity,
Chaining In this method, instead of hashing function value as location we use it as an index into an array of pointers. Every pointer access a chain that holds the element havi
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