What Is Missing In This Logic Of Finding A Path In The Tree For #501

What is missing in this logic of finding a path in the tree for a given sum (i.e checking whether there will be a path from roots to leaf nodes with given sum)?</p> <pre><code class="language-java"> checkSum(struct bin-treenode *root , int sum) : if(root==null) return sum as 0 else : leftover_sum=sum-root_node-->value //missing </code></pre>

Online Quiz 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 missing in this logic of finding a path in the tree for a given sum (i.e checking whether there will be a path from roots to leaf nodes with given sum)?

 checkSum(struct bin-treenode *root , int sum) : if(root==null) return sum as 0 else : leftover_sum=sum-root_node-->value //missing 

Similar question(s) are as followings:



Online Quizzes of gs121 Data Structures and Algorithms

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background