1.
How is Data in a queue accessed
A. First in First out B. First in last out C. Last in First out D. None of these
2. Item in priority queue can jump to the front on the line if they have priority
A. TRUE B. FALSE C. None of these
Explanation:
A priority queue is similar to a simple queue in that items are organized in a line and
processed sequentially. However, items on a priority queue can jump to the front of the
line if they have priority. Priority is a value that is associated with each item placed in
the queue.
3. The dequeue process removes data from the front of the single ended queue
A. TRUE B. FALSE C. None of these
4. Time taken for addition of element in queue is
A. O(1) B. O(n) C. O(log n) D. None of these
options
Explanation:
I think this answer should be A. O(1). because this question is asked about the normal
queue.
For priority queue this should be O(log n).
5. A linear list of elements in which deletion can be done from one end (front) and
insertion can take place only at the other end (rear) is known as a
A. queue. B. stack. C. tree. D. linked list.
6. A B-tree of minimum degree t can maximum _____ pointers in a node.
A. t-1 B. 2t-1 C. 2t D. t
1. When determining the efficiency of algorithm, the space factor is measured by
a. Counting the maximum memory needed by the algorithm
b. Counting the minimum memory needed by the algorithm
c. Counting the average memory needed by the algorithm
d. Counting the maximum disk space needed by the algorithm
2. The complexity of Bubble sort algorithm is
a. O(n)
b. O(log n)
c. O(n2)
d. O(n log n)
3. Linked lists are best suited
a. for relatively permanent collections of data
b. for the size of the structure and the data in the structure are constantly changing
c. for both of above situation
d. for none of above situation
4. If the values of a variable in one module is indirectly changed by
another module, this situation is called
a. internal change
b. inter-module change
c. side effect
d. side-module update
5. In linear search algorithm the Worst case occurs when
a. The item is somewhere in the middle of the array
b. The item is not in the array at all
c. The item is the last element in the array
d. The item is the last element in the array or is not there at all
6. For an algorithm the complexity of the average case is
a. Much more complicated to analyze than that of worst case
b. Much more simpler to analyze than that of worst case
c. Sometimes more complicated and some other times simpler than that of worst case
d. None or above
7. The complexity of merge sort algorithm is
a. O(n)
b. O(log n)
c. O(n2)
d. O(n log n)
8. The complexity of linear search algorithm is
a. O(n)
b. O(log n)
c. O(n2)
d. O(n log n)
9. When determining the efficiency of algorithm the time factor is measured by
a. Counting microseconds
b. Counting the number of key operations
c. Counting the number of statements
d. Counting the kilobytes of algorithm
10. Which of the following data structure is linear data structure?
a. Trees
b. Graphs
c. Arrays
d. None of above
11. The elements of an array are stored successively in memory cells because
a. by this way computer can keep track only the address of the first element and the
addresses of other elements can be calculated
b. the architecture of computer memory does not allow arrays to store other than
serially
c. both of above
d. none of above
12. Which of the following data structure is not linear data structure?
a. Arrays
b. Linked lists
c. Both of above
d. None of above
13. The Average case occur in linear search algorithm
a. When Item is somewhere in the middle of the array
b. When Item is not in the array at all
c. When Item is the last element in the array
d. When Item is the last element in the array or is not there at all
14. Two main measures for the efficiency of an algorithm are
a. Processor and memory
b. Complexity and capacity
c. Time and space
d. Data and space
15. Finding the location of the element with a given value is:
a. Traversal
b. Search
c. Sort
d. None of above
16. Which of the following case does not exist in complexity theory
a. Best case
b. Worst case
c. Average case
d. Null case
17. The operation of processing each element in the list is known as
a. Sorting
b. Merging
c. Inserting
d. Traversal
18. Arrays are best data structures
a. for relatively permanent collections of data
b. for the size of the structure and the data in the structure are constantly changing
c. for both of above situation
d. for none of above situation
19. Each array declaration need not give, implicitly or explicitly, the information
about
a. the name of array
b. the data type of array
c. the first data from the set to be stored
d. the index set of the array
20. The complexity of Binary search algorithm is
a. O(n)
b. O(log )
c. O(n2)
d. O(n log n)
Correct Answers to Data Structures And
Algorithms MCQs
1-A 2-B 3-B 4-C 5-D 6-A 7-D 8-A 9-B 10 - C
11 - A
12 - D 13 - A 14 - C 15 - B 16 - D 17 - D 18 - A 19 - C 20 - B
Data Structures And Algorithms
MCQ Questions
Set 02
1. Each data item in a record may be a group item composed of sub-items; those
items which are indecomposable are called
a. elementary items
b. atoms
c. scalars
d. all of above
2. Which of the following is two way list?
a. grounded header list
b. circular header list
c. linked list with header and trailer nodes
d. none of above
3. Which of the following statement is false?
a. Arrays are dense lists and static data structure
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
4. When inorder traversing a tree resulted E A C K F H D B G; the preorder
traversal would return
a. FAEKCDBHG
b. FAEKCDHGB
c. EAFKHDCBG
d. FEAKDCHBG
5. The memory address of the first element of an array is called
a. floor address
b. foundation address
c. first address
d. base address
6. The difference between linear array and a record is
a. An array is suitable for homogeneous data but the data items in a record may have
different data type
b. In a record, there may not be a natural ordering in opposed to linear array.
c. A record form a hierarchical structure but a linear array does not
d. All of above
7. Which of the following name does not relate to stacks?
a. FIFO lists
b. LIFO list
c. Piles
d. Push-down lists
8. Which of the following data structures are indexed structures?
a. linear arrays
b. linked lists
c. both of above
d. none of above
9. The term “push” and “pop” is related to the
a. array
b. lists
c. stacks
d. all of above
10. The memory address of fifth element of an array can be calculated by the
formula
a. LOC(Array[5]=Base(Array)+w(5-lower bound), where w is the number of words
per memory cell for the array
b. LOC(Array[5])=Base(Array[5])+(5-lower bound), where w is the number of words
per memory cell for the array
c. LOC(Array[5])=Base(Array[4])+(5-Upper bound), where w is the number of words
per memory cell for the array
d. None of above
11. Two dimensional arrays are also called
a. tables arrays
b. matrix arrays
c. both of above
d. none of above
12. When new data are to be inserted into a data structure, but there is no available
space; this situation is usually called
a. underflow
b. overflow
c. housefull
d. saturated
13. The situation when in a linked list START=NULL is
a. underflow
b. overflow
c. housefull
d. saturated
14. A variable P is called pointer if
a. P contains the address of an element in DATA.
b. P points to the address of first element in DATA
c. P can store only memory addresses
d. P contain the DATA and the address of DATA
15. Which of the following data structure can’t store the non-homogeneous data
elements?
a. Arrays
b. Records
c. Pointers
d. None
16. Which of the following data structure store the homogeneous data elements?
a. Arrays
b. Records
c. Pointers
d. None
17. Which of the following is not a limitation of binary search algorithm?
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 elements are more than 1000.
18. Binary search algorithm can not be applied to
a. sorted linked list
b. sorted binary trees
c. sorted linear array
d. pointer array
19. A data structure where elements can be added or removed at either end but not
in the middle
a. Linked lists
b. Stacks
c. Queues
d. Deque
20. Which of the following is not the required condition for binary search
algorithm?
a. The list must be sorted
b. there should be the direct access to the middle element in any sublist
c. There must be mechanism to delete and/or insert elements in list
d. none of above
1- d 2- d 3- c 4- b 5- b 6- d 7- a 8- a 9- c 10- a
11- c 12- b 13- a 14- a 15- a 16- a 17- d 18- a 19- d 20- c
1. A data structure where elements can be added or removed at either end but
not in the middle is called …
A. linked lists
B. stacks
C. queues
D. Dequeue
2. Which of the following data structure store the homogeneous data elements?
A. Arrays
B. Records
C. Pointers
D. Lists
3. When new data are to be inserted into a data structure, but there is not
available space; this situation is usually called ….
A. Underflow
B. overflow
C. houseful
D. saturated
4. Which of the following data structures are indexed structures?
A. Linear arrays
B. Linked lists
C. Queue
D. Stack
5. The use of pointers to refer elements of a data structure in which elements are
logically adjacent is ….
A. pointers
B. linked allocation
C. stack
D. queue
6. Arrays are best data structures
A. for relatively permanent collections of data
B. for the size of the structure and the data in the structure are constantly changing
C. for both of above situation
D. for non of above situation
7. Operations on a data structure may be …..
A. creation
B. destruction
C. selection
D. all of the above
8. Which of the following are the operations applicable a primitive data
structures?
A. create
B. destroy
C. update
D. all of the above
9. The way in which the data item or items are logically related defines …..
A. storage structure
B. data structure
C. data relationship
D. data operation
10. Which of the following statement is false?
A. Arrays are dense lists and static data structure.
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.
11. When does top value of the stack changes?
A) Before deletion
B) While checking underflow
C) At the time of deletion
D) After deletion
12. When does top value of the stack changes?
A) Before deletion
B) While checking underflow
C) At the time of deletion
D) After deletion
13. A ……….. is a graph that has weights of costs associated with its edges.
A) Network
B) Weighted graph
C) Both A and B
D) None A and B
14. A …………… is an acyclic digraph, which has only one node with in-degree
0, and other nodes have in-degree 1.
A) Directed tree
B) Undirected tree
C) Dis-joint tree
D) Direction oriented tree
15. State True of 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
16. State true or false. i) The degree of root node is always zero. 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
17. State true of false. i) A node is a parent if it has successor nodes. ii) A node is
child node if out degree is one.
A) True, True
B) True, False
C) False, True
D) False, False
18. Which of the following data structure is linear type?
A) Graph
B) Trees
C) Binary tree
D) Stack
19. Which of the following data structure is linear type?
A) Array
B) Tree
C) Graphs
D) Hierarchy
20. Which of the following data structure is linear type?
A) Array
B) Tree
C) Graphs
D) Hierarchy
21. Which of the following is an application of stack?
A) finding factorial
B) tower of Hanoi
C) infix to postfix conversion
D) all of the above
22. The property of binary tree is
A) The first subset is called left subtree
B) The second subtree is called right subtree
C) The root cannot contain NULL
D) The right subtree can be empty
23. A directed graph is ………………. if there is a path from each vertex to every
other vertex in the digraph.
A) Weakly connected
B) Strongly Connected
C) Tightly Connected
D) Linearly Connected
24. A …………………… does not keep track of address of every element in the
list.
A) Stack
B) String
C) Linear array
D) Queue
25. A …………………… does not keep track of address of every element in the
list.
A) Stack
B) String
C) Linear array
D) Queue
26. …………… is not the component of data structure.
A) Operations
B) Storage Structures
C) Algorithms
D) None of above
27. A ……. is a data structure that organizes data similar to a 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
28. Herder node is used as sentinel in …..
A) Graphs
B) Stacks
C) Binary tree
D) Queues
29. The data structure which is one ended is ………………
A) queue
B) stack
C) tree
D) graph
30. Which of the following is not the type of queue?
A) Ordinary queue
B) Single ended queue
C) Circular queue
D) Priority queue
31. There is an extra element at the head of the list called a ……….
A) Antinel
B) Sentinel
C) List header
D) List head
32. A binary search tree whose left subtree and right subtree differ in height by
at most 1 unit is called ……
A) AVL tree
B) Red-black tree
C) Lemma tree
D) None of the above
33. Which of the following data structure can’t store the non-homogeneous data
elements?
A) Arrays
B) Records
C) Pointers
D) Stacks
34. A ……………….. is a linear list in which insertions and deletions are made to
from either end of the structure.
A) circular queue
B) random of queue
C) priority
D) Dequeue
35. In a circular queue the value of r will be …..
A) r=r+1
B) r=(r+1)% [QUEUE_SIZE – 1]
C) r=(r+1)% QUEUE_SIZE
D) r=(r-1)% QUEUE_SIZE
36. Which data structure allows deleting data elements from and inserting at
rear?
A) Stacks
B) Queues
C) Dequeues
D) Binary search tree
37. Which data structure is used in breadth first search of a graph to hold
nodes?
A) Stack
B) queue
C) Tree
D) Array
38. ……………. Is a pile in which items are added at one end and removed from
the other.
A) Stack
B) Queue
C) List
D) None of the above
39. ………… is very useful in situation when data have to stored and then
retrieved in reverse order.
A) Stack
B) Queue
C) List
D) Link list
40. To represent hierarchical relationship between elements, Which data
structure is suitable?
A) Dequeue
B) Priority
C) Tree
D) Graph
41. Inserting an item into the stack when stack is not full is called ………….
Operation and deletion of item form the stack, when stack is not empty is called
………..operation.
A) push, pop
B) pop, push
C) insert, delete
D) delete, insert
42. Identify the data structure which allows deletions at both ends of the list but
insertion at only one end.
A) Input restricted dequeue
B) Output restricted queue
C) Priority queues
D) Stack
43. Which of the following is not the part of ADT description?
A) Data
B) Operations
C) Both of the above
D) None of the above
44. In a priority queue, insertion and deletion takes place at ………………
A) front, rear end
B) only at rear end
C) only at front end
D) any position
45. ………………. is not an operation performed on linear list a) Insertion b)
Deletion c) Retrieval d) Traversal
A) only a,b and c
B) only a and b
C) All of the above
D) None of the above
46. Linear arrays are also called ……………….
A) Straight line array
B) One-dimensional array
C) Vertical array
D) Horizontal array
47. Linear arrays are also called ……………….
A) Straight line array
B) One-dimensional array
C) Vertical array
D) Horizontal array
48. The time complexity of quick sort is …………..
A) O(n)
B) O(n2)
C) O(n log n)
D) O(log n)
49. A list which displays the relationship of adjacency between elements is said to
be
A) linear
B) non linear
C) linked list
D) trees
50. Which of the following data structure is non-linear type?
A) Strings
B) Lists
C) Stacks
D) Tree
51. Which of the following data structure is non-linear type?
A) Strings
B) Lists
C) Stacks
D) Tree
52. Which of the following data structure is nonlinear type?
A) Strings
B) Lists
C) Stacks
D) Graph
53. Which of the following is non-liner data structure?
A) Stacks
B) List
C) Strings
D) Trees
54. Which of the following data structures are indexed structures?
A) Linear arrays
B) Linked lists
C) Graphs
D) Trees
55. Which of the following data structures are indexed structures?
A) Linear arrays
B) Linked lists
C) Graphs
D) Trees
56. Which of the following data structure is not linear data structure?
A) Arrays
B) Linked lists
C) Both of the above
D) None of the above
57. The advantage of ……………..is that they solve the problem if sequential
storage representation. But disadvantage in that is they are sequential lists.
A) Lists
B) Linked Lists
C) Trees
D) Queues
58. Each node in a linked list has two pairs of ………….. and ……………….
A) Link field and information field
B) Link field and avail field
C) Avail field and information field
D) Address field and link field
59. Each node in a linked list has two pairs of ………….. and ……………….
A) Link field and information field
B) Link field and avail field
C) Avail field and information field
D) Address field and link field
60. The simplest type of data structure is ………………
A) Multidimensional array
B) Linear array
C) Two dimensional array
D) Three dimensional array
61. The simplest type of data structure is ………………
A) Multidimensional array
B) Linear array
C) Two dimensional array
D) Three dimensional array
62. The disadvantage in using a circular linked list is …………………….
A) It is possible to get into infinite loop.
B) Last node points to first node.
C) Time consuming
D) Requires more memory space
63. Which is/are the application(s) of stack
A) Function calls
B) Large number Arithmetic
C) Evaluation of arithmetic expressions
D) All of the above
64. Which of the following statement is true? i) Using singly linked lists and
circular list, it is not possible to traverse the list backwards. ii) To find the
predecessor, it is required to traverse the list from the first node in case of singly
linked list.
A) i-only
B) ii-only
C) Both i and ii
D) None of both
65. Arrays are best data structures …………
A) For relatively permanent collections of data.
B) For the size of the structure and the data in the structure are constantly changing
C) For both of above situation
D) For none of the above
66. Arrays are best data structures …………
A) For relatively permanent collections of data.
B) For the size of the structure and the data in the structure are constantly changing
C) For both of above situation
D) For none of the above
67. Arrays are best data structures
A) for relatively permanent collections of data
B) for the size of the structure and the data in the structure are constantly changing
C) for both of above situation
D) for none of above situation
68. Stack is also called as
A) Last in first out
B) First in last out
C) Last in last out
D) First in first out
69. Which of the following is true about the characteristics of abstract data
types? i) It exports a type. ii) It exports a set of operations
A) True, False
B) False, True
C) True, True
D) False, False
70. State True or False. i) Binary search is used for searching in a sorted array.
ii) The time complexity of binary search is O(logn).
A) True, False
B) False, True
C) False, False
D) True, True
71. State True or False. i) An undirected graph which contains no cycles is called
forest. ii) A graph is said to be complete if there is an edge between every pair of
vertices.
A) True, True
B) False, True
C) False, False
D) True, False
72. State true or false. i) An empty tree is also a binary tree. ii) In strictly binary
tree, the out-degree of every node is either o or 2.
A) True, False
B) False, True
C) True, True
D) False, False
73. A graph is a collection of nodes, called ………. And line segments called arcs
or ……….. that connect pair of nodes.
A) vertices, edges
B) edges, vertices
C) vertices, paths
D) graph node, edges
74. ………… is not the operation that can be performed on queue.
A) Insertion
B) Deletion
C) Retrieval
D) Traversal
75. The logical or mathematical model of a particular organization of data is
called a ………
A) Data structure
B) Data arrangement
C) Data configuration
D) Data formation
76. The logical or mathematical model of a particular organization of data is
called a ………
A) Data structure
B) Data arrangement
C) Data configuration
D) Data formation
77. A linear list in which each node has pointers to point to the predecessor and
successors nodes is called as…
A) Singly Linked List
B) Circular Linked List
C) Doubly Linked List
D) Linear Linked List
78. Which of the following is not the internal sort?
A) Insertion Sort
B) Bubble Sort
C) Merge Sort
D) Heap Sort
79. In the …………….traversal we process all of a vertex’s descendants before
we move to an adjacent vertex.
A) Depth First
B) Breadth First
C) With First
D) Depth Limited
80. A graph is said to be ……………… if the vertices can be 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
81. …………………. Is a directed tree in which out-degree of each node is less
than or equal to two.
A) Unary tree
B) Binary tree
C) Trinary tree
D) Both B and C
82. In ……………, search start at the beginning of the list and check every
element in the list.
A) Linear search
B) Binary search
C) Hash Search
D) Binary Tree search
83. Which if the following is/are the levels of implementation of data structure
A) Abstract level
B) Application level
C) Implementation level
D) All of the above
84. ……………….. level is where the model becomes compatible executable code
A) Abstract level
B) Application level
C) Implementation level
D) All of the above
85. Any node is the path from the root to the node is called
A) Successor node
B) Ancestor node
C) Internal node
D) None of the above
86. Match the following. 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
87. What will be the value of top, if there is a size of stack STACK_SIZE is 5
A) 5
B) 6
C) 4
D) None
88. In a queue, the initial values of front pointer f rare pointer r should be
……..and……….. respectively.
A) 0 and 1
B) 0 and -1
C) -1 and 0
D) 1 and 0
89. In general, the binary search method needs no more than …………….
comparisons.
A) [log2n]-1
B) [logn]+1
C) [log2n]
D) [log2n]+1
1- D 2- B 3- B 4- A 5- B 6- A 7- d 8- d 9- b 10- c
11- d 12- d 13- c 14- a 15- b 16- c 17- b 18- d 19- a 20- a
21- d 22- d 23- b 24- c 25- c 26- d 27- a 28- c 29- b 30- b
31- b 32- a 33- a 34- d 35- c 36- b 37- b 38- b 39- a 40- c
41- a 42- a 43- d 44- d 45- d 46- b 47- b 48- c 49- a 50- d
51- d 52- d 53- d 54- a 55- a 56- d 57- b 58- a 59- a 60- b
61- b 62- a 63- d 64- c 65- a 66- a 67- a 68- a 69- c 70- d
71- a 72- c 73- a 74- d 75- a 76- a 77- c 78- c 79- a 80- b
81- b 82- a 83- d 84- c 85- b 86- c 87- c 88- b 89- d 90- b
91- 92- 93- 94- 95- 96- 97- 98- 99- 100-
90. The number of comparisons done by sequential search is ………………
A) (N/2)+1
B) (N+1)/2
C) (N-1)/2
D) (N+2)/2
1.What is data structure?
A data structure is a way of organizing data that considers not only the items stored, but
also their relationship to each other. Advance knowledge about the relationship between
data items allows designing of efficient algorithms for the manipulation of data.
2.Minimum number of queues needed to implement the priority queue?
Two. One queue is used for actual storing of data and another for storing priorities.
3.What are the notations used in Evaluation of Arithmetic Expressions using
prefix and postfix forms?
Polish and Reverse Polish notations.
4.List out few of the Application of tree data-structure?
i)The manipulation of Arithmetic expression
ii)Symbol Table construction
iii)Syntax analysis.
5.What is the type of the algorithm used in solving the 8 Queens problem?
Backtracking
6.In RDBMS, what is the efficient data structure used in the internal storage
representation?
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.
7. What is a spanning Tree?
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.
8. List out the areas in which data structures are applied extensively?
Compiler Design, Operating System, Database Management System, Statistical
analysis package, Numerical Analysis, Graphics, Artificial Intelligence, Simulation
9. Translate infix expression into its equivalent post fix expression: (A-B)*(D/E)
(A-B)*(D/E) = [AB-]*[DE/] = AB-DE/*
10. What are priority queues?
A priority queue is a collection of elements such that each element has been assigned a
priority.
11. What is a string?
A sequential array of characters is called a string.
12. What is Brute Force algorithm?
Algorithm used to search the contents by comparing each element of array is called Brute
Force algorithm.
13. What are the limitations of arrays?
i)Arrays are of fixed size.
ii)Data elements are stored in continuous memory locations which may not be available
always.
iii)Adding and removing of elements is problematic because of shifting the locations.
14. How can you overcome the limitations of arrays?
Limitations of arrays can be solved by using the linked list.
15. What is a linked list?
Linked list is a data structure which store same kind of data elements but not in continuous
memory locations and size is not fixed. The linked lists are related logically.
16. What is a node?
The data element of a linked list is called a node.
17. What does node consist of?
Node consists of two fields:data field to store the element and link field to store the address
of the next node.
18. What is a queue ?
A Queue is a sequential organization of data. A queue is a first in first out type of data
structure. An element is inserted at the last position and an element is always taken out
from the first position.
19. What are the types of Collision Resolution Techniques and the methods used
in each of the type?
Open addressing (closed hashing),The methods used include:Overflow block
Closed addressing (open hashing),The methods used include:Linked list,Binary tree
20. What are the methods available in storing sequential files ?
Straight merging, Natural merging, Polyphase sort, Distribution of Initial runs.
21. Mention some of the problem solving strategies?
The most widely strategies are listed below
i)Divide and conquer
ii)Binary doubling strategy
iii)Dynamic programming
22. What is divide and conquer method?
The basic idea is to divide the problem into several sub problems beyond which cannot be
further subdivided. Then solve the sub problems efficiently and join then together to get the
solution for the main problem.
23. What is the need for the header?
Header of the linked list is the first element in the list and it stores the number of elements
in the list. It points to the first data element of the list.
24. Define leaf?
In a directed tree any node which has out degree o is called a terminal node or a leaf.
25. What are the applications of binary tree?
Binary tree is used in data processing.
26. What are the different types of traversing?
The different types of traversing are
i)Pre-order traversal-yields prefix from of expression.
ii)In-order traversal-yields infix form of expression.
iii)Post-order traversal-yields postfix from of expression.
27. Define pre-order traversal?
i)Process the root node
ii)Process the left subtree
iii)Process the right subtree
28. Define post-order traversal?
i)Process the left subtree
ii)Process the right subtree
iii)Process the root node
29. Define in -order traversal?
i)Process the left subtree
ii)Process the root node
iii)Process the right subtree
30. What is meant by sorting?
Ordering the data in an increasing or decreasing fashion according to some relationship
among the data item is called sorting.
31. What's the major distinction in between Storage structure and file structure
and how?
The expression of an specific data structure inside memory of a computer system is termed
storage structure in contrast to a storage structure expression in auxiliary memory is
normally known as a file structure.
32. Stack can be described as a pointer. Explain?
Because stack will contain a head pointer which will always point to the top of the Stack.All
Stack Operations are done using Head Pointer. Hence Stack ca be Described as a Pointer
33. What do you mean by: Syntax Error, Logical Error, Run time Error?
Syntax Error-Syntax Error is due to lack of knowledge in a specific language. It is due to
somebody does not know how to use the features of a language.We can know the errors at
the time of compilation.
logical Error-It is due to the poor understanding of the requirement or problem.
Run time Error-The exceptions like divide a number by 0,overflow and underflow comes
under this.
34. What is mean by d-queue?
D-queue stands for double ended queue. It is a abstract data structure that implements a
queue for which elements can be added to front or rear and the elements can be removed
from the rear or front. It is also called head-tail linked list
35. What is AVL tree?
Avl tree is self binary tree in which balancing factor lie between the -1 to 1.It is also known
as self balancing tree.
36. what is binary tree?
Binary tree is a tree which has maximum no. of childrens either 0 or 1 or 2. i.e., there is at
the most 2 branches in every node.
37. What is the difference between a stack and a Queue?
Stack – Represents the collection of elements in Last In First Out order. Operations includes
testing null stack, finding the top element in the stack, removal of top most element and
adding elements on the top of the stack.
Queue - Represents the collection of elements in First In First Out order.Operations include
testing null queue, finding the next element, removal of elements and inserting the
elements from the queue.
Insertion of elements is at the end of the queue.Deletion of elements is from the beginning
of the queue
38. What actions are performed when a function is called?
i)arguments are passed
ii)local variables are allocated and initialized
iii)transferring control to the function
39. What is precision?
Precision refers the accuracy of the decimal portion of a value. Precision is the number of
digits allowed after the decimal point.
40. What do you mean by overflow and underflow?
When new data is to be inserted into the data structure but there is no available space
i.e.free storage list is empty this situation is called overflow.When we want to delete data
from a data structure that is empty this situation is called underflow.
hich of these is the Worst-case time complexity of Quick Sort - and cannot be
expressed in lower order terms ?
(a) O(n)
(b) O(n log n)
(c) O(n2)
(d) O(n3)
(e) O(log n)
Question 2.
Which of these is the worst case time complexity of Merge Sort - and cannot
be expressed in lower order terms ?
(a) O(n)
(b) O(n log n)
(c) O(n2)
(d) O(n3)
(e) O(log n)
Question 3.
Which of these is the average case time complexity of Merge Sort - and
cannot be expressed in lower order terms ?
(a) O(n)
(b) O(n log n)
(c) O(n2)
(d) O(n3)
(e) O(log n)
Question 4.
Which of these is the time complexity involved in building a heap
of n elements - and cannot be expressed in lower order terms ?
(a) O(n)
(b) O(n log n)
(c) O(n2)
(d) O(n3)
(e) O(log n)
Question 5.
A heap is a particular kind of a binary search tree. This statement is:
(a) True
(b) False
Question 6.
The Floyd-Warshall all-pairs shortest path algorithm for finding the shortest
distances between nodes in a graph is an example of:
(a) A Dynamic Programming formulation.
(b) A Greedy Algorithm
(c) A recursion based divide and conquer technique.
Question 7.
A bitwise operation 'f' has an interesting characteristic, such that, if f(a,b) =
c, it always turns out to be the case that f(b,a) = c; f(a,c) = b; f(c,a) = b;
f(b,c) = a; f(c,b) = a. Which of these functions could 'f' possibly be?
(a) f(a,b) = a XOR b
(b) f(a,b) = a + b
(c) f(a,b) = a - b
(d) f(a,b) = a * b
(where a and b are the binary representations of any two non-negative
integers)
Question 8.
A union find data-structure is commonly applied while implementing:
(a) A depth-first search traversal of a graph.
(b) A breadth-first search traversal of a graph.
(c) Computing the minimum spanning tree of a graph using the Kruskal
algorithm.
(d) Computing the all-pairs shortest path in a graph.
Question 9.
Which of these is the worst case time complexity for looking up a key in a
binary search tree - and cannot be expressed in lower order terms ?
(a) O(n)
(b) O(n log n)
(c) O(n2)
(d) O(n3)
(e) O(log n)
Question 10.
The graph algorithm which forms an essential component of the 'make' or
'ant build' used by programmers and software developers is:
(a) Flow maximization algorithm
(b) Shortest path algorithm
(c) Minimum spanning tree algorithm
(d) Bipartite matching
(e) Topological sort
Answer Format
Replace the blanks (represented by three consecutive hyphens) with the
appropriate letter ('a','b','c','d' or 'e') for each of the questions. Then, hit
the submit button.
Do not add any leading, trailing or intermediate spaces.
In case you are unsure about the answer, you can use the letter 'x'.
Your answer should contain ten lines, answering sequentially, all of the
questions 1 to 10.
For example: (Please note that these are NOT the correct answers and this
example is meant only for the purpose of explaining the format)
1:a
2:b
3:c
4:d
5:e
6:a
7:b
8:x
9:d
10:a
7. D
8. D
9. D
10. D
11.
12.
13. S
14. S
15.
16.