300+ TOP DATA STRUCTURES Interview Questions and Answers PDF
300+ TOP DATA STRUCTURES Interview Questions and Answers PDF
HOME Interview Questions MCQs *LAB VIVA CLASS NOTES SEMINAR TOPICS
ONLINE TEST GATE CAT Contact US
Engineering
Questions
Compiler Design,
Operating System,
Database Management System,
Statistical analysis package,
Numerical Analysis,
Graphics,
Artificial Intelligence,
Simulation
Two. One queue is used for actual storing of data and another for
storing priorities.
1. Straight merging,
2. Natural merging,
3. Polyphase sort,
4. Distribution of Initial runs.
Sparse matrix,
Index generation.
13. In tree construction which is the suitable efficient data
structure? (Array, Linked list, Stack, Queue)
Backtracking.
One. If there is only one entry possible in the bucket, when the
collision occurs, there is no way to accommodate the colliding
value. This results in the overlapping of values.
Direct method,
Subtraction method,
Modulo-Division method,
Digit-Extraction method,
Mid-Square method,
Folding method,
Pseudo-random method.
No. The 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.
Compiler Design,
Operating System,
Database Management System,
Statistical analysis package,
Numerical Analysis,
Graphics,
Artificial Intelligence,
Simulation.
Two. One queue is used for actual storing of data and another for
storing priorities.
Prefix Notation:
^ – * +ABC – DE + FG
postfix Notation:
AB + C * DE – – FG + ^
Backtracking.
40. In An Avl Tree, At What Condition The Balancing Is To Be
Done?
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 minimal-spanning tree is
minimum.
45. Difference Between Calloc And Malloc ?
Enqueue is the process that places data at the back of the queue.
The pop() member method removes the value from the top of a
stack, which is then returned by the pop() member method to the
statement that calls the pop() member method.
The symbol “*” tells the computer that you are declaring a
pointer. Actually it depends on context.
In a statement like int *ptr; the ‘*’ tells that you are declaring a
pointer.
In a statement like int i = *ptr; it tells that you want to assign
value pointed to by ptr to variable i.
The symbol “*” is also called as Indirection Operator/
Dereferencing Operator.
There are two main parts, variable identifier and data type and
the third type is optional which is type qualifier like
signed/unsigned.
For example:
STACK follows LIFO. Thus the item that is first entered would be
the last removed.
Create two pointers, each set to the start of the list. Update each
as follows:
while (pointer1)
{
pointer1 = pointer1->next;
pointer2 = pointer2->next;
if(pointer2)pointer2=pointer2->next;
if (pointer1 == pointer2)
{
print (”circularn”);
}
}
72. Whether Linked List Is Linear Or Non-linear Data
Structure?
A node class is a class that, relies on the base class for services
and implementation, provides a wider interface to users than its
base class, relies primarily on virtual functions in its public
interface depends on all its direct and indirect base class can be
understood only in the context of the base class can be used as
base for further derivation can be used to create objects. A node
class is a class that has added new services or functionality
beyond the services inherited from its base class.
75. When Can You Tell That A Memory Leak Will Occur?
The different types of linked list include singly linked list, doubly
linked list and circular linked list.
Creation of a list.
Insertion of a node.
Deletion of a node.
Modification of a node.
Traversal of the list.
Submit
Push operation.
Pop operation.
Peek operation.
Empty check.
Fully occupied check.
Infix Notation.
Prefix Notation.
Postfix Notation.
Submit
113. What Do You Mean By Breadth First Search (bfs)?
114. List The Two Important Key Points Of Depth First Search?
i) If path exists from one node to another node, walk across the
edge – exploring the edge.
ii) If path does not exist from one specific node to any other
node, return to the previous node where we have been before –
backtracking.
Kruskal’s algorithm.
Prim’s algorithm.
117. What Is A Minimum Spanning Tree?
A simple graph is a graph, which has not more than one edge
between a pair of nodes than such a graph is called a simple
graph.
Keep track of the weight ie; size of each tree and always append
the smaller tree to the larger one when performing UNION.
If the table gets too full, the running time for the operations will
start taking too long and inserts might fail for open addressing
with quadratic resolution. A solution to this is to build another
table that is about twice as big with the associated new hash
function and scan down the entire original hash table,
computing the new hash value for each element and inserting it
in the new table. This entire operation is called rehashing.
Linear probing.
Quadratic probing.
Double hashing.
153. What Do You Mean By Open Addressing?
Structure Property.
Heap Order Property.
169. What Is The Need For Priority Queue?
Database implementation.
Indexing on non primary key fields.
171. What Do You Mean By 2-3-4 Tree?
Zig-Zig: If p is not the root, p is the left child and v is also a left
child, then a left-left rotation at g followed by a left-left rotation
at p, brings v as an ancestor of g as well as p.
In binary search tree, the nodes are arranged in such a way that
the left node is having less data value than root node value and
the right nodes are having larger value than that of root. Because
of this while searching any node the value of the target node will
be compared with the parent node and accordingly either left
sub branch or right sub branch will be searched. So, one has to
compare only particular branches. Thus searching becomes
efficient.
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.
191. State The Demerits Of Linked Representation Of Binary
Trees?
Visiting a node.
Traverse the left sub-tree.
Traverse the right sub-tree.
199. What Are The Different Binary Tree Traversal Techniques?
Preorder traversal.
Inorder traversal.
Postorder traversal.
Levelorder traversal.
200. What Is Meant By Binary Tree Traversal?
A full binary tree is a tree in which all the leaves are on the same
level and every non-leaf node has exactly two children.
All intermediate nodes that traverse the given tree from its root
node to the terminal nodes are referred as non-terminal nodes.
The depth of the tree is the depth of the deepest leaf. The height
of the tree is equal to the height of the root. Always depth of the
tree is equal to height of the tree.
For any node ni, the depth of ni is the length of the unique path
from the root to ni. The height of ni is the length of the longest
path from ni to a leaf.
The nodes other than the root and the leaves are called internal
nodes.
This is the unique node in the tree to which further sub-trees are
attached.
Linear Queues – The queue has two ends, the front end and the
rear end. The rear end is where we insert elements and front
end is where we delete elements. We can traverse in a linear
queue in only one direction ie) from front to rear.
Circular Queues – Another form of linear queue in which the last
position is connected to the first position of the list. The circular
queue is similar to linear queue has two ends, the front end and
the rear end. The rear end is where we insert elements and front
end is where we delete elements. We can traverse in a circular
queue in only one direction ie) from front to rear.
Double-Ended-Queue – Another form of queue in which
insertions and deletions are made at both the front and rear
ends of the queue.
223. What Are The Objectives Of Studying Data Structures?
228. Define Data Type And What Are The Types Of Data Type?
Data type refers to the kinds of data that variables may hold in
the programming language. Eg) int, float, char, double – C
Built in data type- int, float, char, double which are defined by
programming language itself
User defined data type- Using the set of built in data types user
can define their own data type
Eg: typedef struct student
{
int roll;
char name;
}S;
S s1;
Where S is a tag for user defined data type which defines the
structure student and s1 is a variable of data type S.
229. Difference Between Abstract Data Type, Data Type And Data
Structure?
LEAVE A REPLY
Your email address will not be published. Required fields are marked *
Comment
Name *
Email *
Website
Post Comment