What Is The Code Below Trying To Printp Pre Langjava #503
What is the code below trying to print?</p> <pre><code class="language-java"> void print(tree *root,tree *node) { if(root ==null) return 0 if(root-->left==node || root-->right==node) || print(root->left,node) ||printf(root->right,node) { print(root->data) } } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs121 Data Structures and Algorithms. It can also be found in gs gs121 Binary Trees - Binary Trees using Linked Lists - Quiz No.1.
What is the code below trying to print?
void print(tree *root,tree *node) { if(root ==null) return 0 if(root-->left==node || root-->right==node) || print(root->left,node) ||printf(root->right,node) { print(root->data) } }
just printing all nodes
not a valid logic to do any task
printing ancestors of a node passed as argument
printing nodes from leaf node to a node passed as argument
Similar question(s) are as followings:
Online Quizzes of gs121 Data Structures and Algorithms
Binary Trees - Binary Search Tree - Quiz No.1
gs gs121 Data Structures and Algorithms
Online Quizzes
Binary Trees - Binary Search Tree - Quiz No.2
gs gs121 Data Structures and Algorithms
Online Quizzes
Binary Trees - Preorder Traversal - Quiz No.1
gs gs121 Data Structures and Algorithms
Online Quizzes