MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Nullable value of leaf nodes and star node are
A
false, false
B
false, true
C
true, false
D
true, true
Explanation: 

Detailed explanation-1: -A node is a leaf node if both left and right child nodes of it are NULL.

Detailed explanation-2: -A null pointer represents a binary tree with no elements–the empty tree. The formal recursive definition is: a binary tree is either empty (represented by a null pointer), or is made of a single node, where the left and right pointers (recursive definition ahead) each point to a binary tree.

Detailed explanation-3: -A leaf node is a node that has no children. A node that does have children is known as an internal node. The root is an internal node, except in the special case of a tree that consists of just one node (and no edges).

Detailed explanation-4: -In a tree data structure, the leaf nodes are also called as External Nodes. External node is also a node with no child. In a tree, leaf node is also called as ‘Terminal’ node.

There is 1 question to complete.