Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.

Data Structures :: Trees

Home > Data Structures > Trees > General Questions

21. Assume that a structure for a Binary Search Tree exists. What does the following function do?

int function(root)
{
current = root;
while (current->left != NULL)
{
current = current->left;
}
return(current->data);
} ?

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

The above snipet will return the leftmost child of the Binary search tree. Which is nothing but the minimum element of the tree

eg: consider series: 4 2 5 6 3 1 8 7

4
/ \
2 5
/ \ \
1 6 8
/
7

In above list 4 is root, according to the code, it travels the nodes 4,2, so that the while loop will be terminated and data at that position 1 wil

Which is the minimum element of the entire tree.

Workspace

Tags:

No Tags on this question yet!

22. In a binary tree certain null entries are replaced by special pointers which point to nodes higher in tree for efficiency. These special pointers are called

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

23. To represent hierarchical relationship between elements the following data structure is not suitable

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

24. A binary tree whose every node has either zero or two children is called

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

25. The depth of a complete binary tree is given by

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

26. When in order traversing a tree resulted E A C K F H D B G; the preorder traversal would return:

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

28. When converting binary tree into extended all the original nodes in binary tree are

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

29. The post order traversal fo a binary tree is DEBFCA. Find out the pre order traversal.

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

30. A full binary tree with n non-leaf nodes contains

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!