Friday, May 1, 2009

Data structure interview questions Part 3

Data structure interview question: How many different trees are possible with 10 nodes ?
Answer:1014
For example, consider a tree with 3 nodes(n=3), it will have the maximum combination of 5 different (ie, 23 - 3 = 5) trees.


   i                  ii                 iii                iv                 v

In general:
If there are n nodes, there exist 2n-n different trees.

Data structure interview question: List out few of the Application of tree data-structure?
Answer:
Ø The manipulation of Arithmetic expression,
Ø Symbol Table construction,
Ø Syntax analysis.

Data structure interview question: List out few of the applications that make use of Multilinked Structures?
Answer:Ø Sparse matrix,
Ø Index generation.

Data structure interview question: In tree construction which is the suitable efficient data structure?
Answer:(a) Array (b) Linked list (c) Stack (d) Queue (e) none
Answer:
(b) Linked list

Data structure interview question:What is the type of the algorithm used in solving the 8 Queens problem?
Answer:Backtracking

Data structure interview question:In an AVL tree, at what condition the balancing is to be done?
Answer:If the ‘pivotal value’ (or the ‘Height factor’) is greater than 1 or less than –1.

No comments:

Post a Comment