Data Structure Questions (1)
Data Structure Questions (1)
For any node “n” in the tree with a right descendent at level “d” all the left descendents of
“n” that are leaves, are also at level “d”
Q2. A linear collection of data elements where the linear node is given by means of pointer
is called
Q4. If the address of A[1][1] and A[2][1] are 1000 and 1010 respectively and each element
occupies 2 bytes then the array has been stored in order.
Q5. An adjacency matrix representation of a graph cannot contain information of : (A) nodes
(B) edges
Q7. An ADT is defined to be a mathematical model of a user-defined type along with the
collection of all operations on that model.
Q8. An algorithm is made up of two independent time complexities f (n) and g (n).
Q.12 A queue is a,
(A) FIFO (First In First Out) list. (B) LIFO (Last In First Out) list.
Q13. Which data structure is needed to convert infix notation to postfix notation?
Q14. Which of the following operations is performed more efficiently by doubly linked list
than by singly linked list?
Q15. The extra key inserted at the end of the array is called a,
Q16. Consider that n elements are to be sorted. What is the worst case time complexity of
Bubble sort?
Q17. A characteristic of the data that binary search uses but the linear search ignores is the .
(A) Order of the elements of the list. (B) Length of the list.
Q18. In Breadth First Search of Graph, which of the following data structure is used?
Q20.What is the result of the following operation Top (Push (S, X))
Which of the following algorithm solves the all pair shortest path problem ?
Dijkstra's algorithm
Floyd's algorithm
Prim's algorithm
Warshall's algorithm
Bubble sort
Insertion sort
Selection sort
8) The way a card game player arranges his cards as he picks them up one by one, is an
example of ?
bubble sort
selection sort
insertion sort
merge sort
Explanation: He scans throught the rest of the cards and pick the one with least value and
places it next to the point till which he has already sorted the cards
The average successful search time for sequential search on 'n' items is ?
n/2
(n - 1)/2
(n + 2)/2
If the sequence of operations - push(1), push(2), pop, push(1), push(2), pop, pop, pop,
push(2), pop are performed on a stack, the sequence of popped out values are ?
2, 2, 1, 1, 2
2, 2, 1, 2, 2
2, 1, 2, 2, 1
2, 1, 2, 2, 2
Show/Hide Answer
Explanation: The elements are popped from the top of the stack.
higher dimension
Traversing
Insertion
Reading
Floor Address
Foundation Address
First Address
Explanation:The memory address of the first element is often called base address in Data
Structure.
-1
Matrix Array
Table Array
Both a and b
Explanation:Two dimensional arrays are called as matrix array and table arrays because
they contains rows and columns.
Overflow
Underflow
Both of above
Explanation:It is the situation when we are trying to delete an item from the empty linked
list.
UB - LB + 1
LB + UB
LB - UB
LB - UB + 1
Show/Hide Answer
Explanation: Binary search can be applied to a list only if the list is either in ascending or
descending order.
Arrays
Stacks
Linked List
Explanation:PUSH is used for inserting an element into the stack and POP is used for
deleting an elements from the stack.
Traversing
Inserting
Deleting
Searching
Show/Hide Answer
Ordinary queue
Circular queue
Priority queue
Nodes that are not root and not leaf are called as internal nodes.
True, True
True, False
False, True
False, False
Any node is the path from the root to the node is called
Successor node
Ancestor node
Internal node
True, True
True, False
False, True
False, False
Function calls
A is an acyclic digraph, which has only one node with indegree 0, and other nodes
have indegree 1.
Directed tree
Undirected tree
Dis-joint tree
9 Is a directed tree in which outdegree of each node is less than or equal to two.
Unary tree
Binary tree
Dinary tree
Both B and C
True, False
False, True
True, True
False, False
A directed graph is if there is a path from each vertex to every other vertex in the
digraph.
Weakly connected
Strongly Connected
Tightly Connected
Linearly Connected
adjacent vertex.
Depth First
Breadth First
With First
Depth Limited
Time Complexity ii) How much memory need to perform the search.
Space Complexity iii) Is the strategy guaranteed to find the solution when there in one.
(N/2)+1
(N+1)/2
(N-1)/2
(N+2)/2
In , search start at the beginning of the list and check every element in the list.
Linear search
Binary search
Hash Search
True, False
False, True
False, False
True, True
Insertion Sort
Bubble Sort
Merge Sort
Heap Sort
True, True
False, True
False, False
True, False
A graph is said to be if the vertices can be split into two sets V1 and V2 such
Partite
Bipartite
Rooted
Bisects
In a queue, the initial values of front pointer f rare pointer r should be …….. and ………..
respectively.
0 and 1
0 and -1
-1 and 0
1 and 0
r=r+1
r=(r+1)% [QUEUE_SIZE – 1]
r=(r+1)% QUEUE_SIZE
r=(r-1)% QUEUE_SIZE
Using singly linked lists and circular list, it is not possible to traverse the list backwards.
To find the predecessor, it is required to traverse the list from the first node in case of singly
linked list.
i-only
ii-only
Both i and ii
None of both
Lists
Linked Lists
Trees
Queues
None
Insertion
Deletion
Retrieval
Traversal
Antinel
Sentinel
List header
List head
A graph is a collection of nodes, called ………. And line segments called arcs or that
edges, vertices
vertices, paths
A is
Network
Weighted graph
Both A and B
None A and B
[log2n]-1
[logn]+1
[log2n]
[log2n]+1