0% found this document useful (0 votes)
7 views

mcq codecrucks

The document contains a series of questions and answers related to data structures, algorithms, and computational theory. It covers topics such as memory addresses, data structures suitable for hierarchical relationships, complexity theory, algorithm efficiency, and various types of data access methods. Each question is followed by multiple-choice answers, with the correct answers provided at the end.

Uploaded by

youssft007777
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

mcq codecrucks

The document contains a series of questions and answers related to data structures, algorithms, and computational theory. It covers topics such as memory addresses, data structures suitable for hierarchical relationships, complexity theory, algorithm efficiency, and various types of data access methods. Each question is followed by multiple-choice answers, with the correct answers provided at the end.

Uploaded by

youssft007777
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Q1: The memory address of the first element is called ?

▪ (A) Floor Address


▪ (B) Foundation
▪ (C) First Address
▪ (D) Base Address

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

▪ (A) Best case


▪ (B) Worst case
▪ (C) Average case
▪ (D) Null case

Q5: The time factor when determining the efficiency of algorithm 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

Q7: What is a heuristic function?

▪ (A) A function to solve mathematical problems


▪ (B) A function which takes parameters of type string and returns an
integer value
▪ (C) A function whose return type is nothing
▪ (D) A function which returns an object
▪ (E) A function that maps from problem state descriptions to measures
of desirability.
Q8: Suppose a circular queue of capacity (n -1) elements is implemented with an array of n
elements. Assume that the insertion and deletion operations are carried out using REAR and
FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect
queue full and queue empty are

▪ (A) full: (REAR+1) mod n == FRONT empty: REAR == FRONT


▪ (B) full: (REAR+1) mod n == FRONT empty: (FRONT+1) mod n ==
REAR
▪ (C) full: REAR == FRONT empty: (REAR+1) mod n == FRONT
▪ (D) full: (FRONT+1) mod n == REAR empty: REAR == FRONT

Q10: Round robin scheduling is simulated using

▪ (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

Q12: The value of first linked list address is ?

▪ (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

Q14: The number of different trees with 8 nodes is

▪ (A) 256
▪ (B) 255
▪ (C) 248
▪ (D) 260
Q15: Find the odd one out

▪ (A) Bin-Packing Problem


▪ (B) TVSP Problem
▪ (C) Knap Sack Problem
▪ (D) OBST Problem
▪ (E) Sum of Subset

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

Q17: An algorithm is complete if

▪ (A) It terminates with a solution when one exists


▪ (B) It starts with a solution
▪ (C) It does not terminate with a solution
▪ (D) It has a loop
▪ (E) It has a decision parameter.

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)

▪ (A) q(n) and q(1) respectively


▪ (B) q(n) and q(n) respectively
▪ (C) q(1) and q(1) respectively
▪ (D) None of the above

Q19: A linear collection of data elements where the linear node is given by means of pointer is
called

▪ (A) Linked list


▪ (B) Node list
▪ (C) Primitive list
▪ (D) None of these
Q20: The expression X=4+2%-8 evaluate

▪ (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

Q22: Two dimensional arrays are also called ?

▪ (A) Matrix Array


▪ (B) Table Array
▪ (C) Both A and B
▪ (D) None of the Above

Q23: A mathematical-model with a collection of operations defined on that model is called

▪ (A) Data Structure


▪ (B) Abstract Data Type
▪ (C) Primitive Data Type
▪ (D) Algorithm

Q24: Select the true statement.

▪ (A) Every binary tree is either complete or full


▪ (B) Every complete binary tree is also a full binary tree
▪ (C) Every full binary tree is also a complete binary tree
▪ (D) No binary tree is both complete and full

Q25: Read the following statements carefully, and choose the correct answer.

I. The Ω notation is Anti Symmetric.


II. The big Oh notation is Semi Equivalence
▪ (A) (I) is FALSE but (II) is TRUE
▪ (B) Both (I), (II) are TRUE
▪ (C) (I) is TRUE but (II) is FALSE
▪ (D) Both (I), (II) are FALSE
▪ (E) (II) is TRUE and (I) cannot be defined
Q26: Can we read a data item at any location of a list within a constant time (i.e. O(1))?

▪ (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

Q27: The two basic types of record access methods are

▪ (A) sequential and random


▪ (B) direct and immediate
▪ (C) sequential and indexed
▪ (D) on-line and real-time
▪ (E) none of above

Q28: Queue is a ———– list.

▪ (A) LIFO
▪ (B) LILO
▪ (C) FILO
▪ (D) FIFO

Q29: Linked lists are not suitable data structures for which one of the following problems

▪ (A) Insertion sort


▪ (B) Binary search
▪ (C) Radix sort
▪ (D) Polynomial manipulation

Q30: Linked lists are not suitable for implementing

▪ (A) Insertion sort


▪ (B) Binary search
▪ (C) Radix sort
▪ (D) Polynomial manipulation

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

Q32: The situation in linked list START=NULL is called ?

▪ (A) The situation in linked list START=NULL is called ?


▪ (B) Overflow
▪ (C) Underflow
▪ (D) Both of above

Q33: Which of the following data structure is non-linear type?

▪ (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?

▪ (A) The algorithm has ‘n’ nested loops


▪ (B) The computation time taken by the algorithm is proportional to n
▪ (C) The algorithm is ‘n’ times slower than a standard algorithm
▪ (D) There are ‘n’ number of statements in the algorithm
▪ (E) The computation time taken by the algorithm is less than ‘n’
seconds.

Q36: 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

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.

▪ (A) little; simple


▪ (B) large; simple
▪ (C) large; complex
▪ (D) little; complex

Q40: Applications of Queue are

▪ (A) Simulation, event driven systems


▪ (B) Postfix and prefix manipulations
▪ (C) Dictionary systems, polynomial manipulations
▪ (D) Fixed block storage allocation, garbage collection

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

Q43: Which of the following data structure is Non-linear type ?

▪ (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

▪ (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

Q47: An algorithm A is admissible if

▪ (A) It is not guaranteed to return an optimal solution when one exists


▪ (B) It is guaranteed to return an optimal solution when one exists
▪ (C) It returns more solutions, but not an optimal one
▪ (D) It guarantees to return more optimal solutions
▪ (E) It returns no solutions at all.

Q48: The data structure required for Breadth First Traversal on a graph is

▪ (A) Queue
▪ (B) Stack
▪ (C) Array
▪ (D) Tree

Q49: The two basic types of record access methods are

▪ (A) sequential and random


▪ (B) direct and immediate
▪ (C) sequential and indexed
▪ (D) on-line and real-time
▪ (E) none of above
Q50: Which file organization is allowed by a direct access storage device?

▪ (A) direct only


▪ (B) sequential and direct only
▪ (C) indexed and direct only
▪ (D) sequential, indexed and direct
▪ (E) none of above

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) Linked list


▪ (B) Stack
▪ (C) Queue
▪ (D) Circular singly linked list

Q53: Representation of data structure in memory is known as

▪ (A) Recursive
▪ (B) Abstract data type
▪ (C) Storage structure
▪ (D) File structure

Q54: The value of the following expression (13/4*3)%5+1 is

▪ (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

▪ (A) Item is somewhere in the middle of the array


▪ (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 is not there at all

Q57: At a given node of a simple graph, the number of loops are _


▪ (A) More than one
▪ (B) Not more than one
▪ (C) Zero
▪ (D) Exactly two
▪ (E) Equal to the number of nodes of the graph

Q58: All of the following are disadvantage of RPG except:

▪ (A) it is a very machine dependent language


▪ (B) it is very limited in scope
▪ (C) is not suited for complex problems requiring extensive
programming logic
▪ (D) it has larger storage requirements
▪ (E) all of the above are disadvantages

Q59: Which file organization is allowed by a direct access storage device?

▪ (A) direct only


▪ (B) sequential and direct only
▪ (C) indexed and direct only
▪ (D) sequential, indexed and direct
▪ (E) none of above

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

Q71: Which data structure is used to implement priority queue?

▪ (A) Stack
▪ (B) Queue
▪ (C) Min Heap
▪ (D) Max Heap

Q72: The operation of processing element is called ?

▪ (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

▪ (A) count must be zero.


▪ (B) count must be SIZE
▪ (C) count must be SIZE-2
▪ (D) count must be SIZE+1
▪ (E) count could be zero or SIZE, but no other values could occur.

Q77: What kind of list is best to answer questions such as “What is the item at position n?”

▪ (A) Lists implemented with an array


▪ (B) Doubly-linked lists
▪ (C) Singly-linked lists
▪ (D) Doubly-linked or singly-linked lists are equally best
▪ (E) Circular linked list implemented with priorities
Q78: Which of the following is most oriented to scientific programming?

▪ (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

Q81: What is Data Structure ?

▪ (A) Way to organize data


▪ (B) Accessing of data elements in specified manner
▪ (C) Organization of mathematical and logical concepts
▪ (D) All of Above

Q82: An algorithm that calls itself directly or indirectly is known as

▪ (A) Sub algorithm


▪ (B) Recursion
▪ (C) Polish notation
▪ (D) Traversal algorithm

Q84: The complexity of the average case of an algorithm 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
Q87: What is the value of the postfix expression 6 3 2 4 + – *

▪ (A) Something between 5 and 15


▪ (B) Something between -5 and -15
▪ (C) Something between -15 and -100
▪ (D) Something between 15 and 100.

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

Q89: One disadvantage of a direct access file is:

▪ (A) the delay in computing the storage address


▪ (B) duplication of address locations
▪ (C) unused, but available, storage locations
▪ (D) all of above

Answers:
Question Q81 Q82 Q84 Q87 Q88 Q89
Answer D B A D A A

Q91: Which operation is not possible on Data Structure ?

▪ (A) Traversing
▪ (B) Insertion
▪ (C) Reading
▪ (D) Deletion

Q92: Recursive functions are executed in a

▪ (A) First in first out-order


▪ (B) Last in first out-order
▪ (C) Parallel fashion
▪ (D) Load balancing
Q94: The complexity of linear search algorithm is

▪ (A) O(n)
▪ (B) O(log n)
▪ (C) O(n )2

▪ (D) O(n log n)

Q96: The problem space of means-end analysis has

▪ (A) An initial state and one or more goal states


▪ (B) One or more initial states and one goal state
▪ (C) One or more initial states and one or more goal state
▪ (D) One initial state and one goal state
▪ (E) No goal state

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.

▪ (A) Input-restricted deque


▪ (B) Output-restricted deque
▪ (C) Priority queues
▪ (D) None of above

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

Q103: A node in a linked list must contain at least

▪ (A) Three fields


▪ (B) Two fields
▪ (C) Four fields
▪ (D) One field

Q104: The data structure required to evaluate a postfix expression is

▪ (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

Q106: Applications of Linked List are

▪ (A) Simulation, event driven systems


▪ (B) Postfix and prefix manipulations
▪ (C) Dictionary systems, polynomial manipulations
▪ (D) Fixed block storage allocation, garbage collection

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_____

▪ (A) Create a node when free space pool is empty.


▪ (B) Traverse the nodes when free space pool is empty.
▪ (C) Create a node when linked list is empty.
▪ (D) None of these.

Q109: A linear collection of data elements where the linear node is given by means of pointer is
called

▪ (A) Linked list


▪ (B) Node list
▪ (C) Primitive list
▪ (D) None of these

Answers:
Question Q101 Q102 Q103 Q104 Q105 Q106 Q107 Q108 Q109
Answer C A B B A D A A A

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy