Question
Consider the following C++-like pseudo-code for a binary
tree traversal:   ```cpp   struct Node {     int data;     Node left;     Node right;   };   void trickyTraversal(Node root) {     if (root == nullptr) {       return;     }     if (root->left != nullptr) {       trickyTraversal(root->left);     }     std::cout data right != nullptr) {       trickyTraversal(root->right);     }   }   ```   Given the following binary tree:   ```      10      / \     5  15     / \  /    2  7 12   ```   What will be the output of `trickyTraversal(root)` where `root` points to the node with data `10`?ÂSolution
The `trickyTraversal` function is an Inorder Traversal.       It first recursively visits the left child.       Then it prints the current node's data.       Then it recursively visits the right child.     This is the definition of an Inorder Traversal.     For the given tree:     ```        10        / \       5  15       / \  /      2  7 12     ```     Inorder traversal: Left -> Root -> Right     1. `trickyTraversal(10)`       1.1. `trickyTraversal(5)`         1.1.1. `trickyTraversal(2)`           1.1.1.1. `trickyTraversal(nullptr)` -> return           1.1.1.2. Print `2`           1.1.1.3. `trickyTraversal(nullptr)` -> return         1.1.2. Print `5`         1.1.3. `trickyTraversal(7)`           1.1.3.1. `trickyTraversal(nullptr)` -> return           1.1.3.2. Print `7`           1.1.3.3. `trickyTraversal(nullptr)` -> return       1.2. Print `10`       1.3. `trickyTraversal(15)`         1.3.1. `trickyTraversal(12)`           1.3.1.1. `trickyTraversal(nullptr)` -> return           1.3.1.2. Print `12`           1.3.1.3. `trickyTraversal(nullptr)` -> return         1.3.2. Print `15`         1.3.3. `trickyTraversal(nullptr)` -> return     Output: `2 5 7 10 12 15`
Skin, Intestine and Glands are the example of :
Which of the following diseases is caused by a bacteria named 'Pseudomonas Solanacearum'?
Which cell type is primarily responsible for liver function?
Which vitamin is also known as 'Ascorbic Acid'?
Rinderpest, also known as cattle plague, is caused by which type of pathogen?
Which act was passed by the British government to increase their grip on power in India, allowing them to arrest individuals without trial?
Which of the following is essential for the synthesis to thyroxin?
Which is the only muscle in the human body that is NOT attached at both the ends?
What is the scientific study of animal behavior known as?
Study of Beauty is called