Ada Assignment 2 Gate Based Aptitude1
Ada Assignment 2 Gate Based Aptitude1
Ada Assignment 2 Gate Based Aptitude1
Email *
NAME
Himanshu Chouhan
USN NO
1ST22CY018
1. Which of the following statements is true about the time complexity of 1/1
an algorithm?
Feedback
https://docs.google.com/forms/d/e/1FAIpQLSduV5K6CYCiv_1WUSoHRNkKwO23wCCOUFD19HQhCioKKm2mew/viewscore?vc=0&c=0&w=1&flr… 1/9
8/10/24, 10:29 AM Ada Assignment 2 Gate Based Aptitude
2.Which of the following is the correct Big O notation for the time 1/1
complexity of binary search?
O(n)
O(n log n)
O(log n)
O(1)
3. Which of the following sorting algorithms has the worst-case time 1/1
complexity of O(n^2)?
a) Merge Sort
b) Quick Sort
c) Bubble Sort
d) Heap Sort
O(1)
b) O(log n)
c) O(n)
d) O(n log n)
https://docs.google.com/forms/d/e/1FAIpQLSduV5K6CYCiv_1WUSoHRNkKwO23wCCOUFD19HQhCioKKm2mew/viewscore?vc=0&c=0&w=1&flr… 2/9
8/10/24, 10:29 AM Ada Assignment 2 Gate Based Aptitude
Big O (O)
d) Little o (o)
6. Which data structure is used to implement a LIFO (Last In, First Out) 1/1
structure?
a) Queue
b) Stack
c) Linked List
d) Tree
a) Contains no cycles
c) Is fully connected
https://docs.google.com/forms/d/e/1FAIpQLSduV5K6CYCiv_1WUSoHRNkKwO23wCCOUFD19HQhCioKKm2mew/viewscore?vc=0&c=0&w=1&flr… 3/9
8/10/24, 10:29 AM Ada Assignment 2 Gate Based Aptitude
8. What is the best-case time complexity of the insertion sort algorithm? 1/1
O(n)
O(n log n)
O(n^2)
O(log n)
Breadth-First Search
Depth-First Search
Binary Search
Correct answer
https://docs.google.com/forms/d/e/1FAIpQLSduV5K6CYCiv_1WUSoHRNkKwO23wCCOUFD19HQhCioKKm2mew/viewscore?vc=0&c=0&w=1&flr… 4/9
8/10/24, 10:29 AM Ada Assignment 2 Gate Based Aptitude
10. The primary operation performed by Prim's algorithm in finding the 0/1
Minimum Spanning Tree is:
Selection
Insertion
Comparison
Deletion
Correct answer
Selection
12. Which of the following techniques is used by the quicksort algorithm? 1/1
a) Greedy approach
c) Dynamic programming
d) Backtracking
https://docs.google.com/forms/d/e/1FAIpQLSduV5K6CYCiv_1WUSoHRNkKwO23wCCOUFD19HQhCioKKm2mew/viewscore?vc=0&c=0&w=1&flr… 5/9
8/10/24, 10:29 AM Ada Assignment 2 Gate Based Aptitude
13. The complexity class NP consists of decision problems that can be 1/1
14. In the context of graph algorithms, which algorithm is used to detect 1/1
cycles in a directed graph?
a) Depth-First Search
b) Breadth-First Search
c) Dijkstra’s Algorithm
d) Floyd-Warshall Algorithm
15. Which of the following statements is true about the complexity classes 0/1
P and NP?
a) P = NP
b) P is a subset of NP
c) NP is a subset of P
Correct answer
b) P is a subset of NP
https://docs.google.com/forms/d/e/1FAIpQLSduV5K6CYCiv_1WUSoHRNkKwO23wCCOUFD19HQhCioKKm2mew/viewscore?vc=0&c=0&w=1&flr… 6/9
8/10/24, 10:29 AM Ada Assignment 2 Gate Based Aptitude
a) Merge Sort
b) Quick Sort
c) Kruskal's Algorithm
d) Depth-First Search
18. In a heap data structure, the time complexity to extract the maximum 0/1
element is
a) O(1)
b) O(log n)
c) O(n)
d) O(n log n)
Correct answer
b) O(log n)
https://docs.google.com/forms/d/e/1FAIpQLSduV5K6CYCiv_1WUSoHRNkKwO23wCCOUFD19HQhCioKKm2mew/viewscore?vc=0&c=0&w=1&flr… 7/9
8/10/24, 10:29 AM Ada Assignment 2 Gate Based Aptitude
A. Merge Sort
B. Quick Sort
C. Heap Sort
D. Binary Search
This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy
Forms
https://docs.google.com/forms/d/e/1FAIpQLSduV5K6CYCiv_1WUSoHRNkKwO23wCCOUFD19HQhCioKKm2mew/viewscore?vc=0&c=0&w=1&flr… 8/9
8/10/24, 10:29 AM Ada Assignment 2 Gate Based Aptitude
https://docs.google.com/forms/d/e/1FAIpQLSduV5K6CYCiv_1WUSoHRNkKwO23wCCOUFD19HQhCioKKm2mew/viewscore?vc=0&c=0&w=1&flr… 9/9