Data Structure Lab
Data Structure Lab
QUESTIONS ANSWER
1. Write the postfix form of the expression: (A + B) * (C - D) AB+CD-*
2. What is the maximum number of nodes in a binary tree of 2k+1-1 where k >= 1
height k?
3. Queue data structure
Which data structure suits the most in the tree construction?
5. When can you tell that a Memory Leak will occur? A memory leak occurs when a program does
not free a block of memory allocated
dynamically.
6. What is a queue? A queue is a form of data structure that
induces a list of data. In this form of
structure, the old elements are removed from
one end while the new ones keep getting
added to the other end.
7. What is a linked list? A linked list is a sequence of nodes in which
each node is connected to the node following
it. This forms a chain-like link for data
storage.
8. What are binary trees? A binary tree is one type of data structure
that has two nodes, a left node, and a right
node. In programming, binary trees are an
extension of the linked list structures.
9. What is a graph? A graph is one type of data structure that
contains a set of ordered pairs. These
ordered pairs are also referred to as edges or
arcs and are used to connect nodes where
data can be stored and retrieved.
10. What is an algorithm? An algorithm is a step by step method of solving
a problem or manipulating data. It defines a set
of instructions to be executed in a certain order
to get the desired output.
DATA STRUCTURES FAQ’S
16. Write the stack overflow condition. Overflow occurs when top = Maxsize -1
20. Which data structures are used in BFS and DFS algorithm? o In BFS algorithm, Queue data
structure is used.
o In DFS algorithm, Stack data
DATA STRUCTURES FAQ’S
structure is used.
26. What are the parameters that are cared for an algorithm? Time Complexity and Space Complexity.
27. What are Abstract Datatypes? ADTs are the special datatypes constructed
from the collection of data items.
29. What is peek() operation in Stack? It returns top most element of Stack.
30. What is the condition of Stack Overflow? top=n-1, where n is the number of elements
in stack.
DATA STRUCTURES FAQ’S
31. What is the basic condition to check whether a circular queue (rear+1)%size=front
is full or not?
32. What is degree of a node? It is the number of subtree(s) of a node.
33. What is the degree of a tree? It is the maximum degree of node in tree. A
node of tree with degree 0 i.e no child is
called leaf node.
34. What is the depth of a tree? It is also known as the height of a tree. It
represents the maximum level of tree.
35. Differentiate between binary tree and tree. In an ordinary tree, parent may have many
children, but a binary tree can have atmost 2
children.
36. What is the depth of binary tree with ‘n’ nodes? D = log(base 2)(n)+1
37. Explain the game of Tower of Hanoi. The Tower of Hanoi is a mathematical game
or puzzle. It consists of three rods and a
number of disks of different sizes, which can
slide onto any rod. The puzzle starts with the
disks in a neat stack in ascending order of
size on one rod, the smallest at the top, thus
making a conical shape.
38. In Tower of Hanoi game, what could be the possible number 31.
of moves for 5 disks?
39. How can we overcome drawbacks of BST? Using AVL Trees.
40. What is AVL Tree? Concept of AVL Tree was given by
Adelson, Velski, Landis. AVL trees are
height balancing BST. It checks the height
of left&right subtree and assures that
difference is not more than 1, this difference
is termed as balanced factor.
41. Define Path & cycle? Path represents the sequence of adjacent
vertices whereas a cycle represents a closed
path.
42. What is Spanning Tree? It is a subset of a graph, which has all the
vertices covered with minimum possible
number of edges. It does not have cycles and
can’t be disconnected.
43. What is MST?
MST is minimum spanning tree. It is a
spanning tree having minimum weight than
any other spanning tree in the same graph.
58. Which data structure is ideal to perform recursion operation Stack is the most ideal for recursion
and why? operation. This is mainly because of its
LIFO (Last In First Out) property, it
remembers the elements & their positions, so
it exactly knows which one to return when a
function is called.
61. What is the type of the algorithm used in solving the 8 Backtracking.
Queens problem?
62. In an AVL tree, at what condition the balancing is to be If the 'pivotal value' (or the 'Height factor') is
done? greater than 1 or less than -1.
63. What is the bucket size, when the overlapping and collision One. If there is only one entry possible in the
occur at same time? bucket, when the collision occurs, there is no
way to accommodate the colliding value.
DATA STRUCTURES FAQ’S
73. Name a few graph data structure applications. Applications of graph data structures in real-
time are:
• Social graphs
• Path optimization algorithms
• Recommendation engines
• Scientific computations
74. How do you detect a loop in a linked list? • Using Floyd's cycle-finding
Algorithm
• Using hashing
• Using the visited nodes method
75. What is the max heap in the data structure? A max heap in a data structure is a complete
binary tree where each internal node's value
is greater than or equal to that node's
children's values.
76. Some of the applications of stack are as
What are different application of stack. follows:
- Function calls.
- Reversal of a string.
- Checking validity of an expression
containing nested parenthesis.
- Conversion of infix expression to postfix.
77. The process of attempting for solving a
What is an iterative algorithm? problem which finds successive
approximations for solution, starting from an
initial guess. The result of repeated
calculations is a sequence of approximate
values for the quantities of interest.
a. Recursive algorithm is a method of
What is an recursive algorithm? simplification that divides the problem into
sub-problems of the same nature. The result
DATA STRUCTURES FAQ’S
88.
Multi-linked data structures are used in
Where are Multi-linked Data Structures used? many domains. Following are the two most
important use cases of multi-linked data
structures:
89.
Inorder traversal works in the following
What is the method used for inorder traversal in trees? way:
Integer = 0
121. If the depth of a tree is 3 levels, then what is the size of the
Tree ?
A. 2 D. 8
B. 4
C. 6
D. 8
A. LIFO
B. FIFO
D. Recursion
123.
In case of the worst timing, which might be the worst to A. Quick
implement in sorting algorithm ?
A. Quick
B. Merge
C. Time
D. Heap
DATA STRUCTURES FAQ’S
A. ω(n4)
A. ω(n4)
B. O(n3)
C. Both Equally
D. Can't be said
C. O(1)
A. O(n)
B. O(n2)
C. O(1)
D. O(log n)
A. Quick B. Radix
B. Radix
C. Bubble
D. Heap
DATA STRUCTURES FAQ’S
129. Backtracking.
Which algorithm used in solving the 8 Queens problem.
• In-order Traversal,
• Pre-order Traversal,
• Post-order Traversal,
141. How to find the height of a node in a tree? The height of the node is equal to the
number of edges in the longest path to the
leaf from the node. The depth of a leaf node
is 0.
157. In An Avl Tree, At What Condition The Balancing Is To Be If the ‘pivotal value’ (or the ‘Height factor’)
Done? is greater than 1 or less than –1.
176. What is Brute Force algorithm? Algorithm used to search the contents by
comparing each element of array is called
Brute Force algorithm.
177. In RDBMS, what is the efficient data structure used in the internal B+ tree. Because in B+ tree, all the data is
storage representation? stored only in leaf nodes, that makes
searching easier. This corresponds to the
records that shall be stored in leaf nodes.
178. How can you overcome the limitations of arrays? Limitations of arrays can be solved by using
the linked list.
179. What are the types of Collision Resolution Techniques and the Open addressing (closed hashing),The
methods used in each of the type? methods used include:Overflow block.
Closed addressing (open hashing),The
methods used include:Linked list,Binary
tree.
180. Mention some of the problem solving strategies? The most widely strategies are listed below:
181. What are the limitations of arrays? • Arrays are of fixed size.
• Data elements are stored in continuous
memory locations which may not be
available always.
DATA STRUCTURES FAQ’S
182. What are the different types of traversing? The different types of traversing are:
189.
The below-given problems find their
Give some examples greedy algorithms? solution using the greedy algorithm
approach −
191.
Tower of Hanoi, is a mathematical puzzle
What is the tower of Hanoi? which consists of three towers (pegs) and
more than one rings. All rings are of
different size and stacked upon each other
where the large disk is always below the
small disk. The aim is to move the tower of
the disk from one peg to another, without
breaking its properties.
DATA STRUCTURES FAQ’S
192.
Explain Divide & Conquer algorithm? Algorithms following D&C approach works
in two steps-Divide & Combine. Atfirst we
divide the problem into subparts, solve them
individually and then combine the result of
all subparts to get a collective solution.
194.
What is 2D Array? 2D array or 2 dimensional array is array of
arrays. It is used to store the data in tabular
form-in the terms of rows and columns.
196. (rear+1)%size=front
What is the basic condition to check whether a circular queue
is full or not?
parent of p (p-parent-parent)”.
208. Which if the following is/are the levels of implementation of D) All of the above
data structure
A) Abstract level
B) Application level
C) Implementation level
D) All of the above
209. A binary search tree whose left subtree and right subtree A) AVL tree
differ in hight by at most 1 unit is called ……
A) AVL tree
B) Red-black tree
C) Lemma tree
D) None of the above
A) Abstract level
B) Application level
C) Implementation level
D) All of the above
212. Which of the following is true about the characteristics of C) True, True
abstract data types?
DATA STRUCTURES FAQ’S
i) It exports a type.
A) True, False
B) False, True
C) True, True
D) False, False
A) Operations
B) Storage Structures
C) Algorithms
D) None of above
214. Which of the following is not the part of ADT description? D) None of the above
A) Data
B) Operations
215. Inserting an item into the stack when stack is not full is called A) push, pop
…………. Operation and deletion of item form the stack,
when stack is not empty is called ………..operation.
A) push, pop
B) pop, push
DATA STRUCTURES FAQ’S
C) insert, delete
D) delete, insert
216. ……………. Is a pile in which items are added at one end B) Queue
and removed from the other.
A) Stack
B) Queue
C) List
A) Stack
B) Queue
C) List
D) Link list
218. Which data structure allows deleting data elements from and B) Queues
inserting at rear?
A) Stacks
B) Queues
C) Dequeues
219. Which of the following data structure can’t store the non- A) Arrays
homogeneous data elements?
A) Arrays
B) Records
C) Pointers
D) Stacks
220. . A ……. is a data structure that organizes data similar to a A) Queue linked list
line in the supermarket, where the first one in line is the first
one out.
C) Both of them
D) Neither of them
A) Stacks
B) List
C) Strings
D) Trees
A) Graphs
B) Stacks
C) Binary tree
D) Queues
223. Which data structure is used in breadth first search of a graph B) queue
to hold nodes?
A) Stack
B) queue
C) Tree
D) Array
224. Identify the data structure which allows deletions at both A) Input restricted dequeue
ends of the list but insertion at only one end.
C) Priority queues
D) Stack
225. Which of the following data structure is non linear type? D) Graph
A) Strings
B) Lists
DATA STRUCTURES FAQ’S
C) Stacks
D) Graph
A) Graph
B) Trees
C) Binary tree
D) Stack
A) Dequeue
B) Priority
C) Tree
D) Graph
A) Weakly connected
B) Strongly Connected
C) Tightly Connected
D) Linearly Connected
DATA STRUCTURES FAQ’S
A) Depth First
B) Breadth First
C) With First
D) Depth Limited
A) (N/2)+1
B) (N+1)/2
C) (N-1)/2
D) (N+2)/2
233. . In ……………, search start at the beginning of the list and A) Linear search
check every element in the list.
A) Linear search
B) Binary search
C) Hash Search
A) True, False
DATA STRUCTURES FAQ’S
B) False, True
C) False, False
D) True, True
235. Which of the following is not the internal sort? C) Merge Sort
A) Insertion Sort
B) Bubble Sort
C) Merge Sort
D) Heap Sort
A) True, True
B) False, True
C) False, False
D) True, False
A) Partite
B) Bipartite
C) Rooted
D) Bisects
238. In a queue, the initial values of front pointer f rare pointer r B) 0 and -1
should be …….. and ……….. respectively.
A) 0 and 1
B) 0 and -1
C) -1 and 0
D) 1 and 0
A) r=r+1
B) r=(r+1)% [QUEUE_SIZE – 1]
C) r=(r+1)% QUEUE_SIZE
D) r=(r-1)% QUEUE_SIZE
A) i-only
B) ii-only
C) Both i and ii
D) None of both
241. The advantage of …………….. is that they solve the problem B) Linked Lists
if sequential storage representation. But disadvantage in that
is they are sequential lists.
A) Lists
B) Linked Lists
C) Trees
D) Queues
A) 5
B) 6
C) 4
D) None
A) Insertion
B) Deletion
DATA STRUCTURES FAQ’S
C) Retrieval
D) Traversal
244. There is an extra element at the head of the list called a B) Sentinel
……….
A) Antinel
B) Sentinel
C) List header
D) List head
245. A graph is a collection of nodes, called ………. And line A) vertices, edges
segments called arcs or ……….. that connect pair of nodes.
A) vertices, edges
B) edges, vertices
C) vertices, paths
246. . A ……….. is a graph that has weights of costs associated C) Both A and B
with its edges.
A) Network
B) Weighted graph
C) Both A and B
D) None A and B
DATA STRUCTURES FAQ’S
247. In general, the binary search method needs no more than D) [log2n]+1
……………. comparisons.
A) [log2n]-1
B) [logn]+1
C) [log2n]
D) [log2n]+1
248. Which of the following is not the type of queue? B) Single ended queue
A) Ordinary queue
C) Circular queue
D) Priority queue
249. The property of binary tree is D) The right subtree can be empty
ii) Nodes that are not root and not leaf are called as internal
DATA STRUCTURES FAQ’S
nodes.
A) True, True
B) True, False
C) False, True
D) False, False
251. Any node is the path from the root to the node is called B) Ancestor node
A) Successor node
B) Ancestor node
C) Internal node
A) True, True
B) True, False
C) False, True
D) False, False
253. ………………. is not an operation performed on linear list D) None of the above
DATA STRUCTURES FAQ’S
B) only a and b
A) Function calls
255. A …………… is an acyclic digraph, which has only one A) Directed tree
node with indegree 0, and other nodes have in-degree 1.
A) Directed tree
B) Undirected tree
C) Dis-joint tree
A) Unary tree
DATA STRUCTURES FAQ’S
B) Binary tree
C) Trinary tree
D) Both B and C
A) True, False
B) False, True
C) True, True
D) False, False
258. Which of the following data structures are indexed A. Linear arrays
structures?
A. Linear arrays
B. Linked lists
C. Queue
D. Stack
259. Which of the following data structure store the homogeneous B. Records
data elements?
A. Arrays
DATA STRUCTURES FAQ’S
B. Records
C. Pointers
D. Lists
260. When new data are to be inserted into a data structure, but B. overflow
there is not available space; this situation is usually called ….
A. Underflow
B. overflow
C. houseful
D. saturated
A. linked lists
B. stacks
C. queues
D. dequeue
A. creation
B. destruction
C. selection
DATA STRUCTURES FAQ’S
263. The way in which the data item or items are logically related B. data structure
defines …..
A. storage structure
B. data structure
C. data relationship
D. data operation
264. Which of the following are the operations applicable an D. all of the above
primitive data structures?
A. create
B. destroy
C. update
A. pointers
B. linked allocation
C. stack
D. queue
266. Arrays are best data structures A. for relatively permanent collections of
data
A. for relatively permanent collections of data
B. for the size of the structure and the data in the structure are
DATA STRUCTURES FAQ’S
constantly changing
267. Which of the following statement is false? C. Pointers store the next data element of a
list.
A. Arrays are dense lists and static data structure.
A) Strings
B) Lists
C) Stacks
D) Tree
269. Which of the following data structure is linear type? A) Array
A) Array
B) Tree
C) Graphs
D) Hierarchy
270. The logical or mathematical model of a particular A) Data structure
organization of data is called a ………
A) Data structure
B) Data arrangement
DATA STRUCTURES FAQ’S
C) Data configuration
D) Data formation
271. The simplest type of data structure is ……………… B) Linear array
A) Multidimensional array
B) Linear array
B) One-dimensional array
C) Vertical array
D) Horizontal array
273. Arrays are best data structures ………… A) For relatively permanent collections of
data.
A) For relatively permanent collections of data.
B) For the size of the structure and the data in the structure
are constantly changing
A) Linear arrays
B) Linked lists
C) Graphs
DATA STRUCTURES FAQ’S
D) Trees
275. Each node in a linked list has two pairs of ………….. and A) Link field and information field
……………….
A) Stack
B) String
C) Linear array
D) Queue
277. When does top value of the stack changes? D) After deletion
A) Before deletion
D) After deletion
278. . Which of the following data structure is linear type? A) Array
A) Array
B) Tree
C) Graphs
D) Hierarchy
DATA STRUCTURES FAQ’S
A) Data structure
B) Data arrangement
C) Data configuration
D) Data formation
280. The simplest type of data structure is ……………… B) Linear array
A) Multidimensional array
B) Linear array
B) One-dimensional array
C) Vertical array
D) Horizontal array
282. Arrays are best data structures ………… A) For relatively permanent collections of
data.
A) For relatively permanent collections of data.
B) For the size of the structure and the data in the structure
are constantly changing
A) Linear arrays
B) Linked lists
C) Graphs
D) Trees
284. Each node in a linked list has two pairs of ………….. and A) Link field and information field
……………….
A) Stack
B) String
C) Linear array
D) Queue
286. When does top value of the stack changes? D) After deletion
A) Before deletion
D) After deletion
287. Which of the following data structure is non-linear type? D) Tree
A) Strings
B) Lists
C) Stacks
DATA STRUCTURES FAQ’S
D) Tree
288. Which of the following data structure is linear type? A) Array
A) Array
B) Tree
C) Graphs
D) Hierarchy
289. The logical or mathematical model of a particular A) Data structure
organization of data is called a ………
A) Data structure
B) Data arrangement
C) Data configuration
D) Data formation
290. The simplest type of data structure is ……………… B) Linear array
A) Multidimensional array
B) Linear array
B) One-dimensional array
C) Vertical array
D) Horizontal array
292. Arrays are best data structures ………… A) For relatively permanent collections of
data.
A) For relatively permanent collections of data.
B) For the size of the structure and the data in the structure
DATA STRUCTURES FAQ’S
A) Linear arrays
B) Linked lists
C) Graphs
D) Trees
294. Each node in a linked list has two pairs of ………….. and A) Link field and information field
……………….
A) Stack
B) String
C) Linear array
D) Queue
296. When does top value of the stack changes? D) After deletion
A) Before deletion
D) After deletion
DATA STRUCTURES FAQ’S
297. Arrays are best data structures A) for relatively permanent collections of
data
A) for relatively permanent collections of data
B) for the size of the structure and the data in the structure
are constantly changing
298. Which of the following data structure is not linear data D) None of the above
structure?
A) Arrays
B) Linked lists
C) Time consuming
D) any position
DATA STRUCTURES FAQ’S
A) O(n)
B) O(n2)
C) O(n log n)
D) O(log n)
302. Which of the following is an application of stack? D) all of the above
A) finding factorial
B) tower of Hanoi
A) queue
B) stack
C) tree
D) graph
304. A list which displays the relationship of adjacency between A) linear
elements is said to be
A) linear
B) non linear
C) linked list
D) trees
305. A graph in which all vertices have equal degree is (A) Complete graph
known as ____
(A) Complete graph
(B) Regular graph
(C) Multi graph
DATA STRUCTURES FAQ’S
(A) n(n+1)/2
(B) n(n-1)/2
(C) n 2 /2
(D) n
316. If two trees have same structure and but different (D) Similar trees
node content, then they are called ___
(A) Synonyms trees
(B) Joint trees
(C) Equivalent trees
(D) Similar trees
317. Which of the following data structure works on the principle Queue
of First Come First Serve?
322. Selection sort first finds them .......... element in the list and 7) D. Smallest element
put it in the first position.
A. Middle element
B. Largest element
C. Last element
D. Smallest element
323. Quick sort is also known as........ 8) D. partition and exchange sort
A. merge sort
B. tree sort
C. shell sort
D. partition and exchange sort
324. The operation that combines the element is of A and B in 9) C. Merging
a single sorted list C with n=r+s element is called....
A. Inserting
B. Mixing
C. Merging
D. Sharing
325. sorting is good to use when alphabetizing large list of C. Radix
names.
A. Merge
B. Heap
C. Radix
D. Bubble
326. The easiest sorting is........ 12) D. selection sort
A. quick sort
B. shell sort
C. heap sort
D. selection sort
327. Which of the following sorting algorithm is of divide and 13) C. Quick sort
conquer type?
A. Bubble sort
B. Insertion sort
C. Quick sort
D. Merge sort
328. If the number of record to be sorted large and the key is 18) C. Quick
long, then ............................................................................................... sorting can be efficient.
A. Merge
B. Heap
C. Quick
D. Bubble
DATA STRUCTURES FAQ’S
329. The time complexity of heap sort is .... 19) D. O(n logn)
A. O(n)
B. O(logn)
C. O(n2)
D. O(n logn)
330. The complexity of selection sort is ....... B. O(n2)
A. O(n)
B. O(n2)
C. O(n logn)
D. O(logn)
331. The worst case occurs in linear search algorithm when....... 1) D. Item is the last element in the array or
A. Item is somewhere in the middle of the array item is not there at all
B. Item is not in the array at all
C. Item is the last element in the array
D. Item is the last element in the array or item is not there at
all
332. If the number of records to be sorted is small, then 2) C. Selection
sorting can be efficient.
A. Merge
B. Heap
C. Selection
D. Bubble
333. The complexity of sorting algorithm measures the .... as a 3) B. running time
function of the number n of items to be
sorter.
A. average time
B. running time
C. average-case complexity
D. case-complexity
334. Which of the following is not a limitation of binary search D. binary search algorithm is not efficient
algorithm? when the data elements more than 1500.
A. must use a sorted array
B. requirement of sorted array is expensive when a lot of
insertion and deletions are needed
C. there must be a mechanism to access middle element
directly
D. binary search algorithm is not efficient when the data
DATA STRUCTURES FAQ’S
C. O(n+logn)
D. O(logn)
342. is the method used by card sorter? 13) A. Radix sort
A. Radix sort
B. Insertion
C. Heap
D. Quick
343. Sorting algorithm is frequently used when n is small where n 14) B. Insertion
is total number of elements.
A. Heap
B. Insertion
C. Bubble
D. Quick
344. Which of the following is not the required condition for 15) C. There must be mechanism to delete
binary search algorithm? and/or insert elements in list.
A. The list must be sorted
B. There should be the direct access to the middle element in
any sub list
C. There must be mechanism to delete and/or insert elements
in list.
D. Number values should only be present
345. Partition and exchange sort is........ A. quick sort
A. quick sort
B. tree sort
C. heap sort
D. bubble sort
346. ............ form of access is used to add and remove nodes 1) B. FIFO, First In First Out
from a queue.
A. LIFO, Last In First Out
B. FIFO, First In First Out
C. Both a and b
D. None of these
347. Form of access is used to add remove nodes from a stack. 2) A. LIFO
A. LIFO
B. FIFO
C. Both A and B
D. None of these
348. New nodes are added to the ........... of the queue. 3) B. Back
A. Front
B. Back
DATA STRUCTURES FAQ’S
C. Middle
D. Both A and B
349. What happens when you push a new node onto a stack? 4) A. The new node is placed at the front of
A. The new node is placed at the front of the linked list the linked list
B. The new node is placed at the back of the linked list
C. The new node is placed at the middle of the linked list
D. No Changes happens
350. Which of the following name does not relate to stacks? 5) A. FIFO lists
A. FIFO lists
B. LIFO lists
C. Piles
D. Push down lists
351. The term push and pop is related to 6) C. Stacks
A. Array
B. Lists
C. Stacks
D. Trees
352. The elements are removal from a stack in ......... order. 7) A. Reverse
A. Reverse
B. Hierarchical
C. Alternative
D. Sequential
353. is the term used to insert an element into stack? 8) A. Push
A. Push
B. Pull
C. Pop
D. Pump
354. is the term used to delete an element from the stack? C.Pop
A. Push
B. Pull
C. Pop
D. Pump
DATA STRUCTURES FAQ’S
355. A pointer variable which contains the location at the top A. Top
element of the stack is called.....
A. Top
B. Last
C. Final
D. End
356. Before inserting into stack one must check the 1) A. Overflow
condition.........
A. Overflow
B. Underflow
C. Maximum elements
D. Existing elements
357. 2) B. Underflow
Before deletion condition into stack ...... has to be checked.
A. Overflow
B. Underflow
C. Maximum elements
D. Existing elements
358. When does Top value of stack change in insertion process? 3) A. Before insertion
A. Before insertion
B. After insertion
C. At the time of insertion
D. While checking overflow
359. Deletion in the linked stack takes place by deleting........ 4) A. Node pointed by the start process
A. Node pointed by the start process.
B. End of the list
DATA STRUCTURES FAQ’S
362. The term dequeue is the contraction of the name........ 7) A. Double ended queue
A. Double ended queue
B. Double side queue
C. Double headed queue
D. Double address queue
363. is a collection of elements such that each element has been 8) A. Priority queue
assigned a processing priority.
A. Priority queue
B. Procedure queue
C. Main queue
D. Interrupt queue
364. Link fields hold pointers to the .......... element in the linked 9) A. Neighboring
representation of stack.
A. Neighboring
DATA STRUCTURES FAQ’S
B. Last
C. First
D. Middle
365. 10) Reversing a great deal of space for each stack in memory A. Decrease the numbers of times overflow
will........... may occur
A. Decrease the numbers of times overflow may occur
B. Increase the numbers of times overflow may occur
C. Increase the number of times underflow may occur
D. Increase the number of times underflow may occur.
366. The operation of processing each element in the list is 1) D. traversal
known as......
A. sorting
B. merging
C. inserting
D. traversal
367. Binary trees with threads are called as....... 2) A. Threaded trees
A. Threaded trees
B. Pointer trees
C. Special trees
D. Special pointer trees
368. In Binary trees nodes with no successor are called...... 3) B. Terminal nodes
A. End nodes
B. Terminal nodes
C. Final nodes
D. Last nodes
369. Trees are said ............ if they are similar and have same 4) D. Copies
contents at corresponding nodes.
A. Duplicate
B. Carbon copy
C. Replica
D. Copies
370. Every node N in a binary tree T except the root has a unique 5) B. Predecessor
parent called the ...................................................................................................... of N.
A. Antecedents
B. Predecessor
C. Forerunner
D. Precursor
DATA STRUCTURES FAQ’S
B. Branch
C. Path
D. Thread
378. The in order traversal of tree will yield a sorted listing of 3) B. Binary search trees
elements of tree in....
A. Binary trees
B. Binary search trees
C. Merging
D. AVL Trees
379. A binary tree whose every node has either zero or two 4) C. Extended binary tree
children is called.........
A. Complete binary tree
B. Binary Search tree
C. Extended binary tree
D. E2 tree
380. In order traversing a tree resulted E A C K F H D B G; the 6) B. FAEKCDHGB
preorder traversal would return.
A. FAEKCDBHG
B. FAEKCDHGB
C. EAFKHDCBG
D. FEAKDCHBG
381. In linked representation of Binary trees LEFT[k] contains 7) A. Data
the ................................................................................................ of at the node N, where k is the
location.
A. Data
B. Location and left child
C. Right child address
D. Null value
382. Three standards ways of traversing a binary tree T with root 8) D. Pre-order, in-order, post-order
R .......
A. Prefix, infix, postfix
B. Pre-process, in-process, post-process
C. Pre-traversal, in-traversal, post-traversal
D. Pre-order, in-order, post-order
383. Which indicates pre-order traversal? 9) C. Root, Left sub-tree, Right sub-tree
A. Left sub-tree, Right sub-tree and root
B. Right sub-tree, Left sub-tree and root
C. Root, Left sub-tree, Right sub-tree
D. Right sub-tree, root, Left sub-tree
DATA STRUCTURES FAQ’S
384. Which indicates in-order traversal? 1) D. Right sub-tree, root, Left sub-tree
A. Left sub-tree, Right sub-tree and root
B. Right sub-tree, Left sub-tree and root
C. Root, Left sub-tree, Right sub-tree
D. Right sub-tree, root, Left sub-tree
385. The line drawn from a node N of tree T to a successor is 2) B. Edge
called .......
A. Path
B. Edge
C. Arrow
D. Route
386. In a binary tree a sequence of consecutive edges is called 3) D. Path
......
A. Rotate
B. Connecting lines
C. Two-way
D. Path
387. Which of the following indicates post-order traversal? 4) A. Left sub-tree, Right sub-tree and root
A. Left sub-tree, Right sub-tree and root
B. Right sub-tree, Left sub-tree and root
C. Root, Left sub-tree, Right sub-tree
D. Right sub-tree, root, Left sub-tree
388. The root R of the binary tree is assigned a level number of B. 0
......
A. 1
B. 0
C. -1
D. Null
389. 6) C. Both left & right sub trees are empty
If node N is a terminal node in a binary tree then its .........
A. Right tree is empty
B. Left tree is empty
C. Both left & right sub trees are empty
D. Root node is empty
390. The line drawn from a node N of tree T to a successor is 3) B. Edge
called .......
E. Path
F. Edge
G. Arrow
H. Route
DATA STRUCTURES FAQ’S
A. Tagged
B. Marked
C. Lebeled
D. Sticked
399. Other name for directed graph is .......... D. Digraph
A. Direct graph
B. Digraph
C. Dir-graph
D. Digraph
400. Graph G is ..................if for any pair u, v of nodes in G there C. Unliterally connected
is a path from u to v or path from v to u.
A. Leterally connected
B. Widely Connected
C. Unliterally connected
D. Literally connected
401. A connected graph T without any cycles is called ........ 13) A. free graph
A. free graph
B. no cycle graph
C. non cycle graph
D. circular graph
402. A connected graph T without any cycles is called a ........ 14) D. All of the above
A. A tree graph
B. Free tree
C. A tree d
D. All of the above
404. In a graph if e=[u,v], Then u and v are called ........ 16) D. All of the above
A. End points of e
B. Adjacent nodes
C. Neighbours
D. All of the above
405. D. traversal
The operation of processing each element in the list is known as
……
A. sorting
B. merging
C. inserting
D. traversal
406. D. Digraph
Another name for the directed graph is ……….
A. Direct graph
B. Digraph
C. Dir-graph
D. Digraph
C. Final nodes
D. Last nodes
411. D. Copies
Trees are said ………. if they are similar and have the same
contents at corresponding nodes.
A. Duplicate
B. Carbon copy
C. Replica
D. Copies
412. A connected graph T without any cycles is called a …….. D. All of the above
A. A tree graph
B. Free tree
C. A tree d
D. All of the above
413. Every node N in a binary tree T except the root has a unique B. Predecessor
parent called the ……… of N.
A. Antecedents
B. Predecessor
C. Forerunner
D. Precursor
415. Sequential representation of binary tree uses …….. A. Array with pointers
A. Array with pointers
B. Single linear array
C. Two-dimensional arrays
D. Three-dimensional arrays
DATA STRUCTURES FAQ’S
416. In a graph, if e=[u,v], Then u and v are called …….. D. All of the above
A. Endpoints of e
B. Adjacent nodes
C. Neighbors
D. All of the above
418. A binary tree whose every node has either zero or two children is C. extended binary tree
called …….
A. complete binary tree
B. binary search tree
C. extended binary tree
D. data structure
420. D. Dn = log2n+1
The depth of the complete binary tree is given by ……
A. Dn = n log2n
B. Dn= n log2n+1
C. Dn = log2n
D. Dn = log2n+1
424. B. Leaf
A terminal node in a binary tree is called …………
A. Root
B. Leaf
C. Child
D. Branch
C. Both a and b
D. None of these
A. INFO fields
B. TOP fields
C. LINK fields
D. NULL fields
DATA STRUCTURES FAQ’S
427. A. LIFO
........ form of access is used to add remove nodes from a
stack.
A. LIFO
B. FIFO
C. Both A and B
D. None of these
B. Begin pointer
C. Start pointer
D. Avail pointer
429. B. Back
New nodes are added to the ......... of the queue.
A. Front
B. Back
C. Middle
D. Both A and B
D. No Changes happens
432. A. FIFO
A queue is a .........
A. FIFO
B. LIFO
C. FILO
D. LOFI
B. LIFO lists
C. Piles
434. B. pop
The retrieval of items in a stack is ........... operation.
A. push
B. pop
C. retrieval
DATA STRUCTURES FAQ’S
D. access
435. C. Stacks
The term push and pop is related to
A. Array
B. Lists
C. Stacks
D. Trees
436. C. TOP
Which is the pointer associated with the stack?
A. FIRST
B. FRONT
C. TOP
D. REAR
437. A. Reverse
The elements are removal from a stack in .......... order.
A. Reverse
B. Hierarchical
C. Alternative
D. Sequential
438. B. push
The insertion operation in the stack is called .........
A. insert
B. push
C. pop
D. top
DATA STRUCTURES FAQ’S
439. A. Push
...... is the term used to insert an element into stack.
A. Push
B. Pull
C. Pop
D. Pump
440. A. LIFO
Stack follows the strategy of ........
A. LIFO
B. FIFO
C. LRU
D. RANDOM
441. C. Pop
.......... is the term used to delete an element from the stack.
A. Push
B. Pull
C. Pop
D. Pump
443. List out few of the applications that make use of Multilinked1. Sparse matrix,
Structures? 2. Index generation
DATA STRUCTURES FAQ’S
A. front
B. rear
C. top
D. list
445. A pointer variable which contains the location at the top element of 4. A. Top
the stack is called .....
A. Top
B. Last
C. Final
D. End
446. Which of the following is an application of stack? 5. D. all of the above
A. finding factorial
B. tower of Hanoi
C. infix to postfix
C) List
D) None of the above
450. ………… is very useful in situation when data have to 9. A) Stack
stored and then retrieved in reverse order.
A) Stack
B) Queue
C) List
D) Link list
451. Which of the following data structure can’t store the non- 10. A) Arrays
homogeneous data elements?
A) Arrays
B) Records
C) Pointers
D) Stacks
452. A ……. is a data structure that organizes data similar to a11. A) Queue linked list
line in the supermarket, where the first one in line is the
first one out.
A) Queue linked list
B) Stacks linked list
C) Both of them
D) Neither of them
453. Which of the following is non-liner data structure? 12. D) Trees
A) Stacks
B) List
C) Strings
D) Trees
454. Herder node is used as sentinel in ….. 13. C) Binary tree
A) Graphs
B) Stacks
C) Binary tree
D) Queues
455. Which of the following data structure is non linear type? 14. D) Graph
A) Strings
B) Lists
C) Stacks
D) Graph
456. A directed graph is ………………. if there is a path from 15. B) Strongly Connected
each vertex to every other vertex in the digraph.
A) Weakly connected
B) Strongly Connected
C) Tightly Connected
D) Linearly Connected
457. In the …………….. traversal we process all of a vertex’s 16. A) Depth First
descendants before we move to an adjacent vertex.
A) Depth First
B) Breadth First
DATA STRUCTURES FAQ’S
C) With First
D) Depth Limited
458. State True of False. 17. B) True, True, False
i) Network is a graph that has weights or costs associated
with it.
ii) An undirected graph which contains no cycles is called
a forest.
iii) A graph is said to be complete if there is no edge
between every pair of vertices.
A) True, False, True
B) True, True, False
C) True, True, True
D) False, True, True
459. Match the following. 18. C) a-iii, b-i, c-ii
a) Completeness i) How long does it take to find a solution
b) Time Complexity ii) How much memory need to
perform the search.
c) Space Complexity iii) Is the strategy guaranteed to find
the solution when there in one.
A) a-iii, b-ii, c-i
B) a-i, b-ii, c-iii
C) a-iii, b-i, c-ii
D) a-i, b-iii, c-ii
460. The number of comparisons done by sequential search is19. B) (N+1)/2
………………
A) (N/2)+1
B) (N+1)/2
C) (N-1)/2
D) (N+2)/2
461. A graph is said to be ……………… if the vertices can be 20. B) Bipartite
split into two sets V1 and V2 such there are no edges
between two vertices of V1 or two vertices of V2.
A) Partite
B) Bipartite
C) Rooted
D) Bisects
462. In a circular queue the value of r will be .. 21. C) r=(r+1)% QUEUE_SIZE
A) r=r+1
B) r=(r+1)% [QUEUE_SIZE – 1]
C) r=(r+1)% QUEUE_SIZE
D) r=(r-1)% QUEUE_SIZE
463. ………… is not the operation that can be performed on 22. D) Traversal
queue.
A) Insertion
B) Deletion
C) Retrieval
DATA STRUCTURES FAQ’S
D) Traversal
464. here is an extra element at the head of the list called a 23. B) Sentinel
……….
A) Antinel
B) Sentinel
C) List header
D) List head
465. In general, the binary search method needs no more than24. D) [log2n]+1
……………. comparisons.
A) [log2n]-1
B) [logn]+1
C) [log2n]
D) [log2n]+1
466. Any node is the path from the root to the node is called 25. B) Ancestor node
A) Successor node
B) Ancestor node
C) Internal node
D) None of the above
467. A …………… is an acyclic digraph, which has only one 26. A) Directed tree
node with indegree 0, and other nodes have in-degree 1.
A) Directed tree
B) Undirected tree
C) Dis-joint tree
D) Direction oriented tree
468. Which of the following data structure store the 27. B. Records
homogeneous data elements?
A. Arrays
B. Records
C. Pointers
D. Lists
469. Which of the following statement is false? 28. C. Pointers store the next data element of
A. Arrays are dense lists and static data structure. a list.
B. Data elements in linked list need not be stored in
adjacent space in memory
C. Pointers store the next data element of a list.
D. Linked lists are collection of the nodes that contain
information part and next pointer.
470. Which of the following data structure is linear type? 29. A) Array
A) Array
B) Tree
C) Graphs
D) Hierarchy
471. Arrays are best data structures ………… 30. A) For relatively permanent collections of
A) For relatively permanent collections of data. data.
B) For the size of the structure and the data in the
structure are constantly changing
DATA STRUCTURES FAQ’S
A. INFO fields
B. TOP fields
C. LINK fields
D. NULL fields
475. In the linked representation of the stack ......... behaves as34. C. Start pointer
the top pointer variable of stack.
A. Stop pointer
B. Begin pointer
C. Start pointer
D. Avail pointer
476. New nodes are added to the ......... of the queue. 35. B. Back
A. Front
B. Back
C. Middle
D. Both A and B
477. What happens when you push a new node onto a stack? 36. A. The new node is placed at the front of
the linked list
A. The new node is placed at the front of the linked list
DATA STRUCTURES FAQ’S
D. No Changes happens
478. State true or false. 37. C) False, True
ii) Nodes that are not root and not leaf are called as
internal nodes.
A) True, True
B) True, False
C) False, True
D) False, False
479. hich of the following data structures are indexed 38. A. Linear arrays
structures?
A. Linear arrays
B. Linked lists
C. Queue
D. Stack
480. Arrays are best data structures 39. A. for relatively permanent collections of
data
A. for relatively permanent collections of data
B. for the size of the structure and the data in the structure
are constantly changing
A) push, pop
B) pop, push
C) insert, delete
D) delete, insert
483. Which is the pointer associated with the availability list? B. AVAIL
42.
A. FIRST
B. AVAIL
C. TOP
D. REAR
B. predecessor node
C. head node
D. last node
C. number of records
DATA STRUCTURES FAQ’S
486. Indexing the ........ element in the list is not possible in linked A. middle
lists. 45.
A. middle
B. first
C. last
487. Sorting a file F usually refers to sorting F with respect to a46. B. Primary key
particular key called .....
A. Basic key
B. Primary key
C. Starting key
D. Index key
488. Quick sort is also known as ........ 47. D. partition and exchange sort
A. merge sort
B. tree sort
C. shell sort
A. k way merging
B. k th merge
C. k+1 merge
D. k-1 merge
O(logn)
490. D. Item is the last element in the array or
1) The worst case occur in linear search algorithm when item is not there at all
.......
DATA STRUCTURES FAQ’S
491. Which of the following is not a limitation of binary search D. binary search algorithm is not efficient
algorithm? when the data elements more than 1500.
A. must use a sorted array 50.
B. requirement of sorted array is expensive when a lot of
insertion and deletions are needed
C. there must be a mechanism to access middle element
directly
D. binary search algorithm is not efficient when the data
elements more than 1500.
492. Define ancestor and descendant ? If there is a path from node n1 to n2, then
n1 is the ancestor of n2 and n2 is the
descendant of n1.
493. What is the difference between Storage structure and file Storage Structure:-The memory that is
structure? allocated to a variable or a constant is stored
in the main memory of the computer that is
RAM which gets deleted as soon as the
function ends. This representation of
allocating the memory is called Storage
Structure
494. Which one of the below is not divide and conquer approach? B - Merge Sort
A - Insertion Sort
B - Merge Sort
C - Shell Sort
D - Heap Sort
DATA STRUCTURES FAQ’S
497. Graph traversal is different from a tree traversal, because C - trees have root.
A - trees are not connected.
B - graphs may have loops.
C - trees have root.
D - None is true as tree is a subset of graph.
499. Recursion uses more memory space than iteration because B - every recursive call has to be stored.
A - it uses stack instead of queue.
B - every recursive call has to be stored.
C - both A & B are true.
D - None of the above are true.
DATA STRUCTURES FAQ’S
500. The worst case complexity of binary search matches with − B - linear search
A - interpolation search
B - linear search
C - merge sort
D - none of the above