mcq codecrucks
mcq codecrucks
Q2: To represent hierarchical relationship between elements, which data structure is suitable ?
▪ (A) Dequeue
▪ (B) Priority
▪ (C) Tree
▪ (D) All of the above
Q4: Which of the following case does not exist in complexity theory
Q5: The time factor when determining the efficiency of algorithm is measured by
▪ (A) Stack
▪ (B) Queue
▪ (C) Tree
▪ (D) Graph
Answers:
Question Q1 Q2 Q4 Q5 Q7 Q8 Q10
Answer D C D B E A B
▪ (A) 0
▪ (B) -1
▪ (C) 1
▪ (D) None of Above
Q13: An ADT is defined to be a mathematical model of a user-defined type along with the collection
of all____________ operations on that model.
▪ (A) Cardinality
▪ (B) Assignment
▪ (C) Primitive
▪ (D) Structured
▪ (A) 256
▪ (B) 255
▪ (C) 248
▪ (D) 260
Q15: Find the odd one out
Q16: Which of the following are essential statement types for describing algorithms?
▪ (A) Sequence
▪ (B) Selection
▪ (C) Repetition
▪ (D) All the above
▪ (E) A and B Only
Q18: When the priority queue is represented by max heap, the insertion and deletion of an
element can be performed in (queue containing n elements)
Q19: A linear collection of data elements where the linear node is given by means of pointer is
called
▪ (A) -6
▪ (B) 6
▪ (C) 4
▪ (D) None
Answers:
Question Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20
Answer A C C A D A C A B
Q25: Read the following statements carefully, and choose the correct answer.
▪ (A) Yes
▪ (B) Yes, only if the list is implemented by pointers (i.e. linked-list)
▪ (C) Yes, only if the list is implemented by an array
▪ (D) No, we need O(n) computation steps no matter what
▪ (A) LIFO
▪ (B) LILO
▪ (C) FILO
▪ (D) FIFO
Q29: Linked lists are not suitable data structures for which one of the following problems
Answers:
Question Q22 Q23 Q24 Q25 Q26 Q27 Q28 Q29 Q30
Answer C B B B C A D B B
Q31: Activation record is stored on
▪ (A) Queue
▪ (B) Stack
▪ (C) Linked list
▪ (D) AVL Tree
▪ (A) Strings
▪ (B) Lists
▪ (C) Stacks
▪ (D) None of above
Q35: When we say an algorithm has a time complexity of O (n), what does it mean?
Q37: To implement Sparse matrix dynamically, the following data structure is used
▪ (A) Trees
▪ (B) Graphs
▪ (C) Priority Queues
▪ (D) Linked List
Q38: Which allows deletion at only one end of the list but allows insertion at both ends of the list?
▪ (A) Deque
▪ (B) Circular queue
▪ (C) Output restricted deque
▪ (D) Input restricted deque
Q39: Electronic spreadsheets are most useful in a situation where relatively …. data must be input
but …… calculations are required.
Answers:
Question Q31 Q32 Q33 Q35 Q36 Q37 Q38 Q39 Q40
Answer B B D B C D C D A
Q42: Length of the linear array can be found by using the formula ?
▪ (A) UB – LB + 1
▪ (B) LB + UB
▪ (C) LB – UB
▪ (D) LB – UB + 1
▪ (A) Strings
▪ (B) Lists
▪ (C) Stacks
▪ (D) None of the above
Q45: Express the formula (n – 2)*(n – 4) using θ notation:
▪ (A) θ (n )
2
▪ (B) θ (8)
▪ (C) θ (log n)
▪ (D) θ (n)
▪ (E) θ (1)
Q46: The space factor when determining the efficiency of algorithm is measured by
Q48: The data structure required for Breadth First Traversal on a graph is
▪ (A) Queue
▪ (B) Stack
▪ (C) Array
▪ (D) Tree
Answers:
Question Q42 Q43 Q45 Q46 Q47 Q48 Q49 Q50
Answer A D A A B A A D
Q51: Which data structure is best suited to reverse the string
▪ (A) Recursive
▪ (B) Abstract data type
▪ (C) Storage structure
▪ (D) File structure
▪ (A) 5.75
▪ (B) 2.95
▪ (C) 1.4875
▪ (D) 0.5
Q55: Breadth first search uses __ as an auxiliary structure to hold nodes for future processing
▪ (A) Stack
▪ (B) Linked list
▪ (C) Graph
▪ (D) B-Tree
▪ (E) Queue
Q56: The Worst case occur in linear search algorithm when
Q60: If we have six stack operations pushing and popping each of A, B and C-such that push (A)
must occur before push (B) which must occur before push (C), then A, C, B is a possible order for
the pop operations, since this could be our sequence : push (A), pop (A), push (B), push (C), pop
(C), pop (B). Which one of the following orders could not be the order the pop operations are run,
if we are to satisfy the requirements described above ?
▪ (A) ABC
▪ (B) CBA
▪ (C) BAC
▪ (D) CAB
Answers:
Question Q51 Q53 Q54 Q55 Q56 Q57 Q58 Q59 Q60
Answer A B A E D C B D D
▪ (A) Stack
▪ (B) Queue
▪ (C) Min Heap
▪ (D) Max Heap
▪ (A) Traversing
▪ (B) Inserting
▪ (C) Deleting
▪ (D) Searching
Q75: Searching the linked list requires linked list be created in ____
▪ (A) Ascending order
▪ (B) Descending order
▪ (C) With underflow condition
▪ (D) Any order
▪ (E) Without underflow condition.
Q76: I have implemented the queue with a circular array, keeping track of first, last, and count (the
number of items in the array). Suppose first is zero, and last is SIZE-1. What can you tell me about
count? The problem space of means-end analysis has
Q77: What kind of list is best to answer questions such as “What is the item at position n?”
▪ (A) FORTRAN
▪ (B) COBOL
▪ (C) BASIC
▪ (D) PL/1
▪ (E) RPG
Q79: Which of the following file organization is most efficient for a file with a high degree of file
activity?
▪ (A) sequential
▪ (B) ISAM
▪ (C) VSAM
▪ (D) B-Tree
▪ (E) All of above
Answers:
Question Q71 Q72 Q75 Q76 Q77 Q78 Q79
Answer C A D E A A A
Q88: Which of the following is not one of the process that a high level language program must go
through before it is ready to be executed?
▪ (A) translation
▪ (B) controlling
▪ (C) lading
▪ (D) linking
▪ (E) all of the above are necessary process
Answers:
Question Q81 Q82 Q84 Q87 Q88 Q89
Answer D B A D A A
▪ (A) Traversing
▪ (B) Insertion
▪ (C) Reading
▪ (D) Deletion
▪ (A) O(n)
▪ (B) O(log n)
▪ (C) O(n )2
Q97: Suppose we have a circular array implementation of the queue type, with ten items in the
queue stored at data[2] through data[11]. The current SIZE is 22. Where does the insert method
place the new entry in the array?
▪ (A) data[1]
▪ (B) data[22]
▪ (C) data[12]
▪ (D) data[11]
▪ (E) data[21]
Q98: Let the following circular queue can accommodate maximum six elements with the following
data
front = 2 rear = 4
queue = _______; L, M, N, ___, ___
What will happen after ADD O operation takes place?
▪ (A) front = 2 rear = 5 queue = ______; L, M, N, O, ___
▪ (B) front = 3 rear = 5 queue = L, M, N, O, ___
▪ (C) front = 3 rear = 4 queue = ______; L, M, N, O, ___
▪ (D) front = 2 rear = 4 queue = L, M, N, O, ___
Q99: Identify the data structure which allows deletions at both ends of the list but insertion at only
one end.
Answers:
Question Q91 Q92 Q94 Q96 Q97 Q98 Q99
Answer C B A A C C B
Q101: The traveling salesman problem involves n cities with paths connecting the cities. The time
taken for traversing through all the cities, without knowing in advance the length of a minimum
tour, is
▪ (A) O(n)
▪ (B) O(n ) 2
▪ (C) O(n!)
▪ (D) O(n/2)
▪ (E) O(2 ) n
Q102: What data structure would you mostly likely see in a non-recursive implementation of a
recursive algorithm?
▪ (A) Stack
▪ (B) Linked list
▪ (C) Queue
▪ (D) Trees
▪ (A) Queue
▪ (B) Stack
▪ (C) Array
▪ (D) Linked-list
Q105: The postfix expression AB + CD – * can be evaluated using a
▪ (A) stack
▪ (B) tree
▪ (C) queue
▪ (D) linked list
Q107: The data structure which allows the insertion at both the ends, but allows the deletion at
only one end is __
▪ (A) Output restricted Deque
▪ (B) Input restricted Deque
▪ (C) Circular queue
▪ (D) Linear queue
▪ (E) Priority queue.
Q108: Overflow condition in linked list may occur when attempting to_____
Q109: A linear collection of data elements where the linear node is given by means of pointer is
called
Answers:
Question Q101 Q102 Q103 Q104 Q105 Q106 Q107 Q108 Q109
Answer C A B B A D A A A