Fill in The Blank
Fill in The Blank
Fill in The Blank
b. Graphs
c. Arrays
d. None of above
9. Which of the following data structure is
non-linear type?
a. String
b. Lists
c. Stacks
d. None of above
10. Which of the following data structure is
linear type?
a. Strings
b. Lists
c. Queues
d. All of above
11. _____________is a step-by-step
procedure for calculation
a. Data structure
b. Abstract Data Type
c. Primitive Data Type
d. Algorithm
12. A mathematical-model with a
collection of operations defined on that
model is called
e. Data structure
f. Abstract Data Type
g. Primitive Data Type
h. Algorithm
13. Representation of data structure in
memory is known as:
a. Recursive
b. Abstract data type
c. Storage structure
d. File structure
14. Which of the following is considered an
Abstract Data Type?
a. Array
b. reference variable
c. any of the primitive types (e.g., int,
double, char)
d. Stack
e. all of the above
15. An algorithm must be generic enough
to solve all problems of a particular class.
a. Finiteness
b. Definiteness
c. Generality
d. Effectiveness
16. The first step of development of an
algorithm is
a. Problem analysis
b. Problem statement
c. Algorithm analysis
d. Implementation
d. none
6. Which among the following pairs of
operations is supported by an array ADT?
a. Store and Retrieve
b. Insert and Delete
c. Copy and Delete
d. Append and Copy
7. The number of elements in array
Array[1:u] is given by
a. (1 - u)
b. (u)
c. (u 1 + 1)
d. (u 1 - 1)
8. The number of elements in array
Array[l1:u1, l2:u2] is given by
a. (u1- l1 1)(u2 l2 - 1)
b. (u1*u2)
c. (u1 l1)(u2 l2)
d. (u1- l1 + 1)(u2 l2 + 1)
9. The number of elements in array
Array[l1:u1, l2:u2, l3:u3] is given by
a. (u1- l1 1)(u2 l2 - 1) (u3 l3 - 1)
b. (u1*u2*u3)
c. (u1 l1)(u2 l2)(u3-l3)
d. (u1- l1 + 1)(u2 l2 + 1)(u3 l3 + 1)
10. For the array A[1:u1, 1:u2] where is
the base address, A[i,1] has its address
given by
a. (i 1)u2
b. + (i 1)u2
c. + i * u2
d. + (I 1) * u1
11. An one-dimensional array array[1:5]
contains _________ elements.
a. 5 b. 4 c. 1 d. 6
12. A two-dimensional array array[1:3,
1:3] contains _________ elements.
a. 3 b. 6 c. 9 d. 7
13. A multi-dimensional array array[0:2,
10:20, 3:4, -10:2] contains _________
elements.
a. 240 b. 858 c. 390 d. 160
14. The memory address of the first
element of an array is called
a. floor address
b. foundation address
c. first address
d. base address
15. 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
16. Which of the following data structures
are indexed structures?
a. linear arrays
b. linked lists
c. both of above
d. none of above
17. Two dimensional arrays are also called
a. tables arrays
b. matrix arrays
c. both of above
d. none of above
18. If the array is A[1:10], what will be the
address of A[5] element of an array having
base address 100.
a. 105
b. 106
c. 107
d. 108
19. If the array is A[1:10, 1:5], ____________
will be the address of A[5,2] element of an
array having base
address 100.
a. 120
b. 121
c. 122
d. 123
20. If the array is A[1:5, 1:2, 1:3],
____________ will be the address of A[1,2,3]
element of an array having base
address 100.
a. 102
b. 104
c. 105
d. None
Unit-3 Stack and Queue
Fill in the blank:1. A ______________ data structure is an
ordered list with insertion and deletion
done at one end of the list
known as top of stack.
2. Stack can be stored in _________ and
_____________.
3. An insertion operation is called as
___________.
a. Infix
b. Prefix
c. Postfix
d. None
10. In which notation operator is comes
before operand?
a. Infix
b. Prefix
c. Postfix
d. None
11. Which of the following is not a
application of Stack?
a. Evaluation of Police notation
b. Tower of Hanoi
c. Stack Machine
d. None
12. Queue works on the principles:
e. FCFS
f. LIFO
g. Both a &b
h. None
13. Which of the following is related to
Queue?
a. Round Robin algorithm
b. Trafic Control System
c. All
d. None
14. The infix expression for the postfix
expression : 5,6,2+*12,4/a. 5*(6+2)-12/4
b. 5+6-2*12/4
c. (5+6)-2/12*4
d. None of above
15. Answer of following postfix expression:
2,3,10+*8,2/a. 20
b. 22
c. 23
d. 24
16. The postfix expression for the infix
expression : a+b*c/d
a. abc*d/+
b. a*bcd/+
c. ab*cd/+
d. abcd*/+
17. The prefix expression for the infix
expression : a+b*c/d
a. +ab*/cd
b. +*ab/cd
c. +a*b/cd
d. None
18. Which of the following is not a type of
Dequeue?
a. Input Restricted Queue
b. Output Restricted Queue
c. a & b both
d. None
19. Which data structure will you use to
evaluate prefix notation?
a. Queue
b. Stack
c. Linked List
d. Array
20. Which of the following is not the
operation on stack?
a. Push
b. Pop
c. Peep
d. Enqueue
21. Which of the following is not the
operation on Queue?
a. Insertion
b. Deletion
c. Updating
Unit-4 Linked List
Multiple Choice Questions:1. A node carries information regarding
a. Data
b. Link
c. Link and Data
d. None
2. A linked list is which type of data
structure.
a. Linear
b. Non Linear
c. Hierarchical
d. None
3. Type of storage is used to represent
Lists
a. Random
b. Sequential
c. Dynamic
d. Logical
4. Linked list are best suited
a. For relatively permanent collections of
data
b. For the size of structure is constantly
changed
c. Both a & b
d. None
5. Linear order linked list is provided
through _________
a. variables
b. arrays
c. Pointer
d. Strings
6. In a Single Link List_________ node
contains no links.
a. First
b. Last
c. last but one
d. middle
7. In Single Linked List a node contain
minimum how many fields(assuming one
for data).
a. 2
b. 3
c. 1
d. None
8. Single link list performs which of the
following methods
1) Insertion
2) Modification
3) Searching
a. 1 and 2
b. 2 and 3
c. 1 and 3
d. All
9. In linked lists there are no NULL links in:
a. Singly linked list
b. Doubly linked list
c. Circular linked list
d. None
10. The list with no node is called as
a. Empty list
b. Null list
c. Zero list
d. None
11. Which of the following is the
application of the singly linked list?
a. Sparse matrix
b. Police notation
c. Tower of Hanoi
d. All
12. Which of the following will contain
more memory space?
a. Singly linked list
b. Doubly linked list
c. Array
d. Circular linked list
13. In polynomial manipulation, nodes
consists of three field representing
a. Coefficient, exponential and link
b. Previous item link, data item, next item
link
c. Coefficient, data item and link
d. None
14. A linked list in which last node contain
the link of the first node is called
a. Singly linked list
b. Doubly linked list
c. Circular linked list
d. All
d. Tree
2. To represent hierarchical relationship
between elements, which data structure is
suitable?
a. Deque
b. Priority
c. Tree
d. All of above
3. A binary tree whose every node has
either zero or two children is called
a. Complete binary tree
b. Binary search tree
c. Extended binary tree
d. None of above
4. The depth of a complete binary tree is
given by
a. Dn = n log2n
b. Dn = n log2n+1
c. Dn = log2n
d. Dn = log2n+1
5. The post order traversal of a binary tree
is DEBFCA. Find out the in order traversal
a. ABFCDE
b. ADBFEC
c. ABDECF
d. None
6. The post order traversal of a binary tree
is DEBFCA. Find out the pre order traversal
a. ABFCDE
b. ADBFEC
c. ABDECF
d. ABDCEF
7. The in order traversal of a binary tree is
ABFCD. Find out the pre order traversal
a. ABFCD
b. ADBFC
c. ABDCF
d. None
8. The in order traversal of tree will yield a
sorted listing of elements of tree in
a. Binary trees
b. Binary search trees
c. Heaps
d. None of above
9. Consider the following tree.
14
/\
2 11
/\/\
1 3 10 30
//
7 40
a. How many leaves does it have?
a. 2
b. 4
c. 6
d. 8
e. 9
b. How many of the nodes have at least
one sibling?
a. 5
b. 6
c. 7
d. 8
e. 9
c. What is the value stored in the parent
node of the node containing 30?
a. 10
b. 11
c. 14
d. none
d. How many descendants does the root
have?
a. 0
b. 2
c. 4
d. 8
e. What is the depth of the tree?
a. 2
b. 4
c. 8
d. None
f. How many children does the root have?
a. 6
b. 7
c. 8
d. 9
10. Which of the following statement is
false?
a. Every tree is a bipartite graph
b. A tree contains cycle
c. A tree with n nodes contains n-1 edges
d. A tree is connected graph
11. A full binary tree with n leaves
contains
a. n nodes
b. log2 n nodes
c. 2n 1 nodes
d. 2n + 1 nodes
12. A full binary tree with n non-leaf nodes
contains
a. logn nodes
b. n + 1 nodes
c. 2n 1 nodes
d. 2n + 1 nodes
13. A complete binary tree of level 5 has
how many nodes?
a. 15
b. 25
c. 63
d. 30
14. Traversing a binary tree first root and
then left and right subtrees called
_____________ traversal.
a. Postorder
b. Preorder
c. Inorder
d. None of these
15. A binary tree of depth d is an almost
complete binary tree if
a. Each leaf in the tree is either at level
b. For any node
c. Both a & b
d. None of these
16. The maximum number of nodes on
level i of a binary tree is
a. 2i.1
b. 3i.1
c. I + 1
d. 2i + 2
17. Number of possible binary trees with 3
nodes is
a. 12
b. 9
c. 14
d. 15
18. A binary tree is generated by inserting
in order of the following integers: 50, 15,
62, 5, 20, 58, 3, 8, 37, 60,
24 the number of nodes in the left of the
root respectively is
a. (4,7)
b. (7,4)
c. (6,3)
d. (3,6)
19. Consider the following tree
6
/\
4 12
/\/\
1 5 10 30
\
11
If this tree is used for sorting, then a new
number 8 should be placed as the
a. Left child of the node labeled 30
b. Right child of the node labeled 5
c. Right child of the node labeled 30
d. Left child of the node labeled 10
20. Which of the following traversal
techniques lists the nodes of a binary
search tree in ascending order?
a. Post-order
b. In-order
c. Pre-order
d. None of the above
Multiple Choice Questions:1. What is the worst-case time for serial
search finding a single item in an array?
a. Constant time
b. Logarithmic time
c. Linear time
d. Quadratic time
2. What is the worst-case time for binary
search finding a single item in an array?
a. Constant time
b. Logarithmic time
c. Linear time
d. Quadratic time
3. 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 sub list
c. There must be mechanism to delete
and/or insert elements in list
d. None of above
4. 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.
5. Binary search algorithm cannot be
applied to
a. sorted linked list
b. sorted binary trees
c. sorted linear array
d. pointer array
6. Which of the following case does not
exist in complexity theory
a. Best case
b. Worst case
c. Average case
d. Null case
7.
7. The Worst case occur in linear search
algorithm when
a. Item is somewhere in the middle of
array
b. Item is not in the array at all
c. Item is the last element in the array
060010201 Data
Structures 2014
Ms.Nehal Adhvaryu Page 26
c. Parallel
d. binary
15. The complexity of Bubble sort
algorithm is
a. O(n)
b. O(log n)
c. O(n2)
d. O(n log n)
16. The complexity of insertion sort
algorithm is
a. O(n)
b. O(log n)
c. O(n2)
d. O(n log n)
17. The complexity of merge sort
algorithm is
a. O(n)
b. O(log n)
c. O(n2)
d. O(n.log2 n)
18. Which of the following sorting
algorithms does not have a worst case
running time of O(n2)
a. Insertion sort
b. Merge sort
c. Quick sort
d. Bubble sort
19. To sort many large objects or
structures, it would be most efficient to
place
a. Them in an array and sort the array