Q. Draw a binary Tree for the expression : A * B – (C + D) * (P / Q)

a.

clip_image001

Posted in Data Structure | Leave a comment

Q. Whether Linked List is linear or Non-linear data structure?

A. According to Access strategies Linked list is a linear one.
According to Storage Linked List is a Non-linear one.

Posted in Data Structure | Leave a comment

Q. Does the minimum spanning tree of a graph give the shortest distance between any 2 specified nodes?

A. No. Minimal spanning tree assures that the total weight of the tree is kept at its minimum. But it doesn’t mean that the distance between any two nodes involved in the minimum-spanning tree is minimum.

Posted in Data Structure | Leave a comment

Q. What is a spanning Tree?

A. A spanning tree is a tree associated with a network. All the nodes of the graph appear on the tree once. A minimum spanning tree is a spanning tree organized so that the total edge weight between nodes is minimized.

Posted in Uncategorized | Leave a comment

Q. Draw the B-tree of order 3 created by inserting the following data arriving in sequence – 92 24 6 7 11 8 22 4 5 16 19 20 78

A.

clip_image001

Posted in Data Structure | Leave a comment

Q. In RDBMS, what is the efficient data structure used in the internal storage representation?

A. 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.

Posted in Uncategorized | Leave a comment

Q. There are 8, 15, 13, 14 nodes were there in 4 different trees. Which of them could have formed a full binary tree?

A. 15.
In general:
There are 2n-1 nodes in a full binary tree.

By the method of elimination:
Full binary trees contain odd number of nodes. So there cannot be full binary trees with 8 or 14 nodes, so rejected. With 13 nodes you can form a complete binary tree but not a full binary tree. So the correct answer is 15.

Posted in Data Structure | Leave a comment

Q. Traverse the given tree using Inorder, Preorder and Postorder traversals.

clip_image001

A:

· Inorder : D H B E A F C I G J

· Preorder: A B D H E C F G I J

Postorder: H D E B F I J G C A

Posted in Data Structure | Leave a comment

Q. In an AVL tree, at what condition the balancing is to be done?

A. If the ‘pivotal value’ (or the ‘Height factor’) is greater than 1 or less than -1.

Posted in Data Structure | Leave a comment

Q. What is the type of the algorithm used in solving the 8 Queens problem?

A. Backtracking

Posted in Data Structure | Leave a comment