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.
Arrays :- To execute a stack we need a variable called top, that holds the index of the top element of stack and an array to hold the part of the stack.
red black tree construction for 4,5,6,7,8,9
write aprogram for random -search to implement if a[i]=x;then terminate other wise continue the search by picking new randon inex into a
Q. Write down a programme in C to create a single linked list also write the functions to do the following operations (i) To insert a new node at the end (ii
A*(B+D)/E-F*(G+H/K)
Typical programming languages such as Pascal, C or Java give primitive data kinds such as integers, boolean, reals values and strings. They give these to be organised into arrays,
Q. Suggest a method of implementing two stacks in one array such that as long as space is there in an array, you should be capable to add an element in either stack. Using proposed
In the array implementation of the lists, we will use the array to hold the entries and a separate counter to keep track of the number of positions are occupied. A structure will b
Explain CAM software CAD/CAM software has been recognized as an essential tool in the designing and manufacturing of a product due to its ability to depict the designs and tool
A circular queue can be implemented through arrays or linked lists. Program 6 gives the array implementation of any circular queue. Program 6: Array implementation of any Circu
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