Uploaded by Dr. Sunil Raj Y

MCQ Answers

advertisement
1. What are the basic steps in the complete development of an algorithm?
a) Input, Output, Processing
b) Analysis, Design, Implementation
c) Analysis, Complexity Analysis, Design
d) Pseudocode, Flowchart, Coding
1. Answer: c
Which notation is used to describe the upper bound of an algorithm’s time complexity?
a) Big O
b) Theta
c) Omega
d) Little O
Answer: a
Which of the following is an example of an Abstract Data Type (ADT)?
a) Integer
b) List
c) Double
d) Character
Answer: b
UNIT-II: Algorithm Design and Trees
Which algorithm design technique solves problems by breaking them into smaller subproblems and combining their solutions?
A) Greedy Method
b) Divide and Conquer
c) Dynamic Programming
d) Backtracking
Answer: b
Which data structure is used to implement a Binary Search Tree (BST)?
a) Array
b) Stack
c) Linked List
d) Queue
Answer: c
In a Binary Search Tree (BST), which property ensures that the left child is smaller and the right child is larger than the parent node?
A) Symmetric Property
b) Associative Property
c) Transitive Property
d) Ordering Property
Answer: d
UNIT-III: Hashing and Priority Queues
What is the purpose of a hash function in hashing?
a) To generate random numbers
b) To create a collision
c) To map data to a fixed-size table
d) To sort data in ascending order
Answer: c
Which collision resolution technique in hashing uses linked lists to store multiple values at the same hash index?
A) Separate Chaining
b) Linear Probing
c) Quadratic Probing
d) Double Hashing
Answer: a
What data structure is often used to implement a priority queue?
a) Stack
b) Queue
c) Binary Heap
d) Linked List
Answer: c
UNIT-IV: Sorting
Which sorting algorithm has a time complexity of O(n^2) in the worst case but is efficient for small datasets?
a) Quick Sort
b) Merge Sort
c) Insertion Sort
d) Heap Sort
Answer: c
Which sorting algorithm works by repeatedly dividing the unsorted list into smaller sublists until each sublist contains only one element?
A) Quick Sort
b) Merge Sort
c) Shell Sort
d) Heap Sort
Answer: b
Which sorting algorithm has an average and worst-case time complexity of O(n log n) and uses a divide-and-conquer approach?
A) Insertion Sort
b) Shell Sort
c) Merge Sort
d) Heap Sort
Answer: c
UNIT-V: Graphs and NP-Completeness
What is a topological sort used for in graphs?
a) Finding the shortest path
b) Detecting cycles
c) Ordering nodes for a directed acyclic graph
d) Identifying strongly connected components
Answer: c
Which algorithm is used to find the minimum spanning tree of a graph?
a) Dijkstra’s algorithm
b) Kruskal’s algorithm
c) Prim’s algorithm
d) Bellman-Ford algorithm
Answer: b
In the theory of NP-Completeness, what does “NP” stand for?
a) Non-Polynomial
b) Non-Possible
c) Non-Practical
d) Non-Priority
Answer: a
Download