Data Structure interview questions

6. State the rules to be followed during infix to prefix conversions?
Fully parenthesize the expression starting from left to right.
The operators having higher precedence are first parenthesized.
Move the operators one by one to their left
Each operator replaces their corresponding left parenthesis.
The part of the expression, which has been converted into prefix is to be treated as single operand.
Once the expression is converted into prefix form, remove all parenthesis.

7. What is Sparse matrix ?
Sparse matrix is a matrix which contains very few non-zero elements. When a sparse matrix is represented with a 2-dimensional array, we waste a lot of space to represent that matrix.

8. What is 8 Queens problem?
The eight queens puzzle is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other; thus, a solution requires that no two queens share the same row, column, or diagonal. The eight queens puzzle is an example of the more general n queens problem of placing n non-attacking queens on an n×n chessboard, for which solutions exist for all natural numbers n with the exception of n = 2 and n = 3.

9. What is AVL tree?
DescriptionIn computer science, an AVL tree is a self-balancing binary search tree. It was the first such data structure to be invented. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is done to restore this property

10. What is the efficient data structure used in the internal storage representation in RDBMS
A B+ tree is an N-ary tree with a variable but often large number of children per node. A B+ tree consists of a root, internal nodes and leaves. B+ tree. Because in B+ tree, all the data is stored only in leaf nodes, that makes searching easier. This corresponds to the records that shall be stored in leaf nodes.

Author: user

Leave a Reply