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.
Q. Explain that how do we implement two stacks in one array A[1..n] in such a way that neither the stack overflows unless the total number of elements in both stacks together is n.
Explain in detail about the Ruby arrays Ruby arrays have many interesting and powerful methods. Besides indexing operations which go well beyond those discussed above, arrays h
how to convert 12 hour format into 24 hour format using c program
Describe Binary Search Tree (BST)? Make a BST for the given sequence of numbers. 45, 36, 76, 23, 89, 115, 98, 39, 41, 56, 69, 48 Traverse the obtained tree in Preorder, Inord
What is called the basic operation of an algorithm? The most significant operation of the algorithm is the operation contributing the most to the total running time is known as
Q. Write an algorithm that counts number of nodes in a linked list. A n s . Algo rithm to Count No. of Nodes in Linked List C
Q. Write down the algorithm for binary search. Which are the conditions under which sequential search of a list is preferred over the binary search?
1. Use the Weierstrass condition, find the (Strongly) minimizing curve and the value of J min for the cases where x(1) = 0, x(2) = 3. 2. The system = x 1 + 2u; where
A Binary Search Tree is binary tree which is either empty or a node having a key value, left child & right child. By analyzing the above definition, we notice that BST comes int
Q. Explain any three methods or techniques of representing polynomials using arrays. Write which method is most efficient or effective for representing the following polynomials.
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