Frequently Asked Data Structures Objective type Questions and Answers pdf

41. State the merits of linear representation of binary trees.
Storage method is easy and can be easily implemented in arrays
When the location of a parent/child node is known, other one can be determined easily
It requires static memory allocation so it is easily implemented in all programming language

42. State the demerit of linear representation of binary trees.
Insertions and deletions in a node take an excessive amount of processing time due to data movement up and down the array.

43. State the merit of linked representation of binary trees.
Insertions and deletions in a node involve no data movement except the rearrangement of pointers, hence less processing time.

44. State the demerits of linked representation of binary trees.
Given a node structure, it is difficult to determine its parent node
Memory spaces are wasted for storing null pointers for the nodes, which have one or no sub-trees
It requires dynamic memory allocation, which is not possible in some programming language

45. Define a binary search tree
A binary search tree is a special binary tree, which is either empty or it should satisfy the following characteristics:
Every node has a value and no two nodes should have the same value i.e) the values in the binary search tree are distinct
The values in any left sub-tree is less than the value of its parent node
The values in any right sub-tree is greater than the value of its parent node
The left and right sub-trees of each node are again binary search trees

46. What do you mean by general trees?
General tree is a tree with nodes having any number of children.

47. What is the use of threaded binary tree?
In threaded binary tree, the NULL pointers are replaced by some addresses. The left pointer of the node points to its predecessor and the right pointer of the node points to its successor.

48. What is an expression tree?
An expression tree is a tree which is build from infix or prefix or postfix expression. Generally, in such a tree, the leaves are operands and other nodes are operators.

49. Define right-in threaded tree
Right-in threaded binary tree is defined as one in which threads replace NULL pointers in nodes with empty right sub-trees.

50. Define left-in threaded tree
Left-in threaded binary tree is defined as one in which each NULL pointers is altered to contain a thread to that node’s in order predecessor.

Read More Questions:
Data Structures Interview Questions Part1
Data Structures Interview Questions Part2
Data Structures Interview Questions Part3
Data Structures Interview Questions Part4
Data Structures Interview Questions Part5

No comments:

Post a Comment