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.
Initially Nodes are inserted in an AVL tree in the same manner as an ordinary binary search tree. Though, the insertion algorithm for any AVL tree travels back along with the pa
/* The program accepts matrix like input & prints the 3-tuple representation of it*/ #include void main() { int a[5][5],rows,columns,i,j; printf("enter the order of
Q. Describe what do you understand by the term array? How does an array vary from an ordinary variable? How are the arrays represented in the specific memory?
Write an algorithm to test whether a Binary Tree is a Binary Search Tree. The algorithm to test whether a Binary tree is as Binary Search tree is as follows: bstree(*tree) {
A queue is a, FIFO (First In First Out) list.
Thread By changing the NULL lines in a binary tree to special links known as threads, it is possible to perform traversal, insertion and deletion without using either a stack
Decision Tree - ID3 algorithm: Imagine you only ever do one of the following four things for any weekend: go shopping watch a movie play tennis just
#questWrite an algorithm for multiplication of two sparse matrices using Linked Lists.ion..
Suppose you are given the results of 5 games of rock-paper-scissors. The results are given to you on separate pieces of paper; each piece says either 'A' if the first person won, o
prove that n/100=omega(n)
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