Question Description
Consider the following function, to which a pointer to the root node of the binary tree T is passed.int Gradeup (Struct Node * root){int a = 0, b = 0, c = 0;if(root == NULL) return 0;if(root → left == NULL && root → right == NULL) return 1;a = Gradeup (root → left);b = Gradeup (root → right);c = 1 + max(a, b);return c;}The above program computes,a)The number of edges in the longest path from root to leaf in Tb)The number of nodes in the longest path from root to leaf in Tc)Number of leaves in Td)Total number of nodes in TCorrect answer is option 'B'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared
according to
the GATE exam syllabus. Information about Consider the following function, to which a pointer to the root node of the binary tree T is passed.int Gradeup (Struct Node * root){int a = 0, b = 0, c = 0;if(root == NULL) return 0;if(root → left == NULL && root → right == NULL) return 1;a = Gradeup (root → left);b = Gradeup (root → right);c = 1 + max(a, b);return c;}The above program computes,a)The number of edges in the longest path from root to leaf in Tb)The number of nodes in the longest path from root to leaf in Tc)Number of leaves in Td)Total number of nodes in TCorrect answer is option 'B'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam.
Find important definitions, questions, meanings, examples, exercises and tests below for Consider the following function, to which a pointer to the root node of the binary tree T is passed.int Gradeup (Struct Node * root){int a = 0, b = 0, c = 0;if(root == NULL) return 0;if(root → left == NULL && root → right == NULL) return 1;a = Gradeup (root → left);b = Gradeup (root → right);c = 1 + max(a, b);return c;}The above program computes,a)The number of edges in the longest path from root to leaf in Tb)The number of nodes in the longest path from root to leaf in Tc)Number of leaves in Td)Total number of nodes in TCorrect answer is option 'B'. Can you explain this answer?.
Solutions for Consider the following function, to which a pointer to the root node of the binary tree T is passed.int Gradeup (Struct Node * root){int a = 0, b = 0, c = 0;if(root == NULL) return 0;if(root → left == NULL && root → right == NULL) return 1;a = Gradeup (root → left);b = Gradeup (root → right);c = 1 + max(a, b);return c;}The above program computes,a)The number of edges in the longest path from root to leaf in Tb)The number of nodes in the longest path from root to leaf in Tc)Number of leaves in Td)Total number of nodes in TCorrect answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE.
Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of Consider the following function, to which a pointer to the root node of the binary tree T is passed.int Gradeup (Struct Node * root){int a = 0, b = 0, c = 0;if(root == NULL) return 0;if(root → left == NULL && root → right == NULL) return 1;a = Gradeup (root → left);b = Gradeup (root → right);c = 1 + max(a, b);return c;}The above program computes,a)The number of edges in the longest path from root to leaf in Tb)The number of nodes in the longest path from root to leaf in Tc)Number of leaves in Td)Total number of nodes in TCorrect answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of
Consider the following function, to which a pointer to the root node of the binary tree T is passed.int Gradeup (Struct Node * root){int a = 0, b = 0, c = 0;if(root == NULL) return 0;if(root → left == NULL && root → right == NULL) return 1;a = Gradeup (root → left);b = Gradeup (root → right);c = 1 + max(a, b);return c;}The above program computes,a)The number of edges in the longest path from root to leaf in Tb)The number of nodes in the longest path from root to leaf in Tc)Number of leaves in Td)Total number of nodes in TCorrect answer is option 'B'. Can you explain this answer?, a detailed solution for Consider the following function, to which a pointer to the root node of the binary tree T is passed.int Gradeup (Struct Node * root){int a = 0, b = 0, c = 0;if(root == NULL) return 0;if(root → left == NULL && root → right == NULL) return 1;a = Gradeup (root → left);b = Gradeup (root → right);c = 1 + max(a, b);return c;}The above program computes,a)The number of edges in the longest path from root to leaf in Tb)The number of nodes in the longest path from root to leaf in Tc)Number of leaves in Td)Total number of nodes in TCorrect answer is option 'B'. Can you explain this answer? has been provided alongside types of Consider the following function, to which a pointer to the root node of the binary tree T is passed.int Gradeup (Struct Node * root){int a = 0, b = 0, c = 0;if(root == NULL) return 0;if(root → left == NULL && root → right == NULL) return 1;a = Gradeup (root → left);b = Gradeup (root → right);c = 1 + max(a, b);return c;}The above program computes,a)The number of edges in the longest path from root to leaf in Tb)The number of nodes in the longest path from root to leaf in Tc)Number of leaves in Td)Total number of nodes in TCorrect answer is option 'B'. Can you explain this answer? theory, EduRev gives you an
ample number of questions to practice Consider the following function, to which a pointer to the root node of the binary tree T is passed.int Gradeup (Struct Node * root){int a = 0, b = 0, c = 0;if(root == NULL) return 0;if(root → left == NULL && root → right == NULL) return 1;a = Gradeup (root → left);b = Gradeup (root → right);c = 1 + max(a, b);return c;}The above program computes,a)The number of edges in the longest path from root to leaf in Tb)The number of nodes in the longest path from root to leaf in Tc)Number of leaves in Td)Total number of nodes in TCorrect answer is option 'B'. Can you explain this answer? tests, examples and also practice GATE tests.