Question

14 2 11 AI 13 10 30 // 740 What is the value stored in the parent node of the node containing 14? 10 14 none of the above 4014 / 2 11 1 3 10 30 7 40 What is the order of nodes visited using a post-order traversal? 13 2 7 10 40 30 11 14 12 3 7 10 11Consider the following function: void test_a(int n) { cout<<n<<; if (n>0) test_a(n-2); } What is printed by the call test_a15 2 11 1 3 10 30 // 740 How many leaves does the tree have? N 4 6 8 9

0 0
Add a comment Improve this question Transcribed image text
Answer #1

  There is no parent node for root. So, there is no node present as parent node of the node containing 14. The answer none of t4 Given function is void test-alint n) w @ cout <<ns @ if (n>0) test_a(n-2); 3 as ① & 2 as shown above I numbered the lines

Add a comment
Know the answer?
Add Answer to:
14 2 11 AI 13 10 30 // 740 What is the value stored in the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 8 Consider the tree below. What is the value stored in the parent node of...

    Question 8 Consider the tree below. What is the value stored in the parent node of the node containing 30? Question 8 options: 10 11 14 40 None of the above Question 9 Consider the tree below. How many descendants does the root have? Question 9 options: 0 2 4 8 Question 10 Consider the tree below. What is the depth of the tree? Question 10 options: 2 3 4 8 9 Question 11 Consider the tree below. How many...

  • 9) 10 pts. What is the final result that will be stored in "a? double a...

    9) 10 pts. What is the final result that will be stored in "a? double a = 3. double b = 12. double c = 4 .; a 3. For 10 & 11 use the following function prototype: void Funl (int a, float c, double d); 10) 5 pts. Write the function call. Include the variable definitions. 11) 5 pts. Write the function header with an empty function body. 12) 5 pts The following code does NOT get a runtime...

  • C++ EXERCISE (DATA STRUCTURES). I just need a code for some functions that are missing. Please...

    C++ EXERCISE (DATA STRUCTURES). I just need a code for some functions that are missing. Please help me figure out. Thanks. C++ BST implementation (using a struct) Enter the code below, and then compile and run the program. After the program runs successfully, add the following functions: postorder() This function is similar to the inorder() and preorder() functions, but demonstrates postorder tree traversal. displayParentsWithTwo() This function is similar to the displayParents WithOne() function, but displays nodes having only two children....

  • LANGUAGE IS C++ Lab Ch14 Recursion In this lab, you are provided with startup code which...

    LANGUAGE IS C++ Lab Ch14 Recursion In this lab, you are provided with startup code which has six working functions that use looping (for, while, or do loops) to repeat the same set of statements multiple times. You will create six equivalent functions that use recursion instead of looping. Although looping and recursion can be interchanged, for many problems, recursion is easier and more elegant. Like loops, recursion must ALWAYS contain a condition; otherwise, you have an infinite recursion (or...

  • 8 3 10 1 6 (14 4 7 13 For each of the following traversal orders,...

    8 3 10 1 6 (14 4 7 13 For each of the following traversal orders, list the order in which nodes in this tree will be visited. (a) Inorder (1) Preorder

  • Your task is to complete the following function/functions: 1. Given a position in the linked list,...

    Your task is to complete the following function/functions: 1. Given a position in the linked list, delete the node at that position.(Silver problem - Mandatory ) 2. Print the sum of all negative elements in the linked list.(Gold problem) If you want, you can refer to the the previous recitation manual (which was on Linked Lists) to implement node deletion. #include <iostream> using namespace std; //----------- Define Node --------------------------------------------------- struct Node{ int key; Node *next; }; //----------- Define Linked List...

  • Part-1: find the longest block (subsequence of elements with same value) in an array. Part-2: find...

    Part-1: find the longest block (subsequence of elements with same value) in an array. Part-2: find all subsequences in an array of int that add up to a given sum. */ #include <iostream> #include <cstdlib> using namespace std; void printSeq(int* a, int s, int e); // -------------------------------------------- functions to be implemented by you void longestBlock(const int* a, int n, int& s, int& e) { // s = start index of the block // e = end index of the block...

  • in Java Write a program DFSTrace that contains a version of a depth first search that...

    in Java Write a program DFSTrace that contains a version of a depth first search that prints a trace of its traversal. Write a public static method: public static void dfsPrintTrace(Graph g) { // *** Declare and initialize the marked array. dfsPrintTrace(g, 0, marked, 0); } This method calls a private method: private static void dfsPrintTrace(Graph g, int start, boolean[] marked, int indent) All references to a method below refer to this second method. Every message printed should be preceded...

  • Lab 6.6 – Using Value and Reference Parameters Below is a copy of the source code....

    Lab 6.6 – Using Value and Reference Parameters Below is a copy of the source code. 1 // Lab 6 swapNums.cpp -- Using Value and Reference Parameters 2 // This program uses a function to swap the values in two variables . 3 // PUT YOUR NAME HERE. 4 #include <iostream> 5 using namespace std; 6 7 // Function prototype 8 void swapNums(int, int); 9 10 /***** main *****/ 11 int main() 12 { 13 int num1 = 5, 14...

  • using java to write,show me the output. please write some common. You CAN NOT use inbuild...

    using java to write,show me the output. please write some common. You CAN NOT use inbuild functions for Tree ADT operations. using code below to finsih public class Main {    public static void main(String[] args) {        BinaryTree tree = new BinaryTree(); tree.root = new Node(1); tree.root.left = new Node(2); tree.root.right = new Node(3); tree.root.left.left = new Node(4); tree.root.left.right = new Node(5); tree.root.right.left = new Node(6); tree.root.right.right = new Node(7); tree.root.left.left.left = new Node(8); tree.root.left.left .right= new Node(9);...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT