Data Structure MCQ Questions
This section focuses on "basics" of Data Structure. These Multiple Choice Questions (MCQ) should be practiced to improve the Data Structure skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. How many cases are there, which are used to compare various data structure's execution time in a relative manner?
A. 2
B. 3
C. 4
D. 5
View Answer
Ans : B
Explanation: There are three cases which are usually used to compare various data structure's execution time in a relative manner : Worst Case ,Average Case and Best Case.
2. Which case of data structure operation takes maximum time?
A. Worst Case
B. Average Case
C. Best Case
D. None of the above
View Answer
Ans : A
Explanation: Worst Case : This is the scenario where a particular data structure operation takes maximum time it can take.
3. In Average case, if operation takes ƒ(n) time in execution, then m operations will take?
A. ƒ(n)
B. f(m)
C. mf(n)
D. nf(m)
View Answer
Ans : C
Explanation: If an operation takes ƒ(n) time in execution, then m operations will take mƒ(n) time.
4. __________ is a single elementary unit of information representing an attribute of an entity.
A. Entity Set
B. Record
C. File
D. Field
View Answer
Ans : D
Explanation: Field is a single elementary unit of information representing an attribute of an entity.
5. What is true about Interface in data structure?
A. Each data structure has an interface.
B. Interface represents the set of operations that a data structure supports.
C. An interface only provides the list of supported operations, type of parameters they can accept and return type of these operations.
D. All of the above
View Answer
Ans : D
Explanation: Interface : Each data structure has an interface. Interface represents the set of operations that a data structure supports. An interface only provides the list of supported operations, type of parameters they can accept and return type of these operations.
6. Which of the following is not a Characteristics of a Data Structure?
A. Completeness
B. Correctness
C. Time Complexity
D. Space Complexity
View Answer
Ans : A
Explanation: Completeness is not a Characteristics of a Data Structure.
7. Which characteristics shows that running time or the execution time of operations of data structure must be as small as possible?
A. Completeness
B. Correctness
C. Time Complexity
D. Space Complexity
View Answer
Ans : C
Explanation: Time Complexity : Running time or the execution time of operations of data structure must be as small as possible.
8. Data items that cannot be divided are called as?
A. Group Items
B. Attribute and Entity
C. Elementary Items
D. File items
View Answer
Ans : C
Explanation: Data items that cannot be divided are called as Elementary Items.
9. Which of the following analysis known as theoretical analysis of an algorithm?
A. A Posterior Analysis
B. A Priori Analysis
C. A Feasibility Analysis
D. A Independent Analysis
View Answer
Ans : B
Explanation: A Priori Analysis : This is a theoretical analysis of an algorithm. Efficiency of an algorithm is measured by assuming that all other factors, for example, processor speed, are constant and have no effect on the implementation.
10. Which of the following analysis known as empirical analysis of an algorithm?
A. A Posterior Analysis
B. A Priori Analysis
C. A Feasibility Analysis
D. A Independent Analysis
View Answer
Ans : A
Explanation: A Posterior Analysis : This is an empirical analysis of an algorithm. The selected algorithm is implemented using programming language. This is then executed on target computer machine. In this analysis, actual statistics like running time and space required, are collected.
11. O(1) means computing time is __________________
A. Constant
B. Quadratic
C. Linear
D. Cubic
View Answer
Ans : A
Explanation: O(1) means computing time is Constant.
12. Which data structure allows deleting data elements from front and inserting at rear?
A. Stacks
B. Queues
C. Deques
D. Binary search tree
View Answer
Ans : B
Explanation: Queues data structure allows deleting data elements from front and inserting at rear.
13. Which of the following sorting algorithm is of divide-and-conquer type?
A. Bubble sort
B. Insertion sort
C. Quick sort
D. Selection sort
View Answer
Ans : C
Explanation: Quick sorting algorithm is of divide-and-conquer type.
14. 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
View Answer
Ans : B
Explanation: The time factor when determining the efficiency of algorithm is measured by Counting the number of key operations.
15. In an array representation of binary tree the right child of root will be at location of?
A. 2
B. 3
C. 4
D. 6
View Answer
Ans : B
Explanation: In an array representation of binary tree the right child of root will be at location of 3.
16. The upper bound on the time complexity of the nondeterministic
sorting algorithm is?
A. O(n)
B. O(n log n)
C. O(1)
D. O( log n)
View Answer
Ans : A
Explanation: The upper bound on the time complexity of the nondeterministic
sorting algorithm is O(n)
17. In analysis of algorithm, approximate relationship between the size of the job and the amount of work required to do is expressed by using _________.
A. Central tendency
B. Differential equation
C. Order of magnitude
D. Order of execution
View Answer
Ans : D
Explanation: In analysis of algorithm, approximate relationship between the size of the job and
the amount of work required to do is expressed by using Order of execution
18. What is the type of the algorithm used in solving the 8 Queens problem?
A. Backtracking
B. Dynamic
C. Branch and Bound
D. Both A and B
View Answer
Ans : A
Explanation: Backtracking algorithm used in solving the 8 Queens problem.
19. Which of the following belongs to the algorithm paradigm?
A. Minimum & Maximum problem
B. Knapsack problem
C. Selection problem
D. Merge sort
View Answer
Ans : B
Explanation: Knapsack problem belongs to the algorithm paradigm.
20. The [] notation is
A. Symmetric
B. Reflexive
C. Transitive
D. All of the above
View Answer
Ans : D
Explanation: The [] notation is All of the above.
21. An algorithm should have _________ well-defined outputs
A. 0
B. 1
C. 0 or more
D. 1 or more
View Answer
Ans : D
Explanation: An algorithm should have 1 or more well-defined outputs, and should match the desired output.
22. __________ of an algorithm represents the amount of memory space required by the algorithm in its life cycle.
A. Space complexity
B. Time Complexity
C. Quadratic Complexity
D. Exponential Complexity
View Answer
Ans : A
Explanation: Space complexity of an algorithm represents the amount of memory space required by the algorithm in its life cycle.
23. The space required by an algorithm is equal to the sum of the following _______ components.
A. 1
B. 2
C. 3
D. 4
View Answer
Ans : B
Explanation: The space required by an algorithm is equal to the sum of the following two components : A fixed part that is a space required to store certain data and variables and A variable part is a space required by variables.
24. Which is the formal way to express the upper bound of an algorithm's running time.
A. Big Oh Notation
B. Omega Notation
C. Theta Notation
D. None of the above
View Answer
Ans : A
Explanation: Big Oh Notation : The notation Ο(n) is the formal way to express the upper bound of an algorithm's running time. It measures the worst case time complexity or the longest amount of time an algorithm can possibly take to complete.
25. The Omega notation is the formal way to express the __________ of an algorithms running time.
A. upper bound
B. medium bound
C. lower bound
D. both the lower bound and the upper bound
View Answer
Ans : C
Explanation: The Omega notation is the formal way to express the lower bound of an algorithm's running time. It measures the best case time complexity or the best amount of time an algorithm can possibly take to complete.
Discussion
shammya79
good questions. liked it. please, try to make it like an actual quiz with time constraint and evaluation. thanks a lot.