Q. Which of the following best describes the relationship between syntax trees and intermediate code?
A.
Syntax trees are generated after intermediate code
B.
Intermediate code is generated directly from syntax trees
C.
Syntax trees and intermediate code are the same
D.
Intermediate code is generated before syntax trees
Show solution
Solution
Intermediate code is often generated from syntax trees, which represent the structure of the source code.
Correct Answer:
B
— Intermediate code is generated directly from syntax trees
Learn More →
Q. Which of the following best describes the space complexity of binary search?
A.
O(n)
B.
O(log n)
C.
O(1)
D.
O(n log n)
Show solution
Solution
Binary search has a space complexity of O(1) when implemented iteratively, as it uses a constant amount of space.
Correct Answer:
C
— O(1)
Learn More →
Q. Which of the following C++ functions can be used to implement binary search on a sorted array?
A.
std::find
B.
std::search
C.
std::binary_search
D.
std::linear_search
Show solution
Solution
The std::binary_search function from the C++ Standard Library can be used to perform binary search on a sorted array.
Correct Answer:
C
— std::binary_search
Learn More →
Q. Which of the following C++ functions can be used to implement binary search?
A.
std::find
B.
std::search
C.
std::binary_search
D.
std::linear_search
Show solution
Solution
The std::binary_search function from the C++ Standard Library can be used to perform binary search.
Correct Answer:
C
— std::binary_search
Learn More →
Q. Which of the following C++ functions correctly implements binary search?
A.
int binarySearch(int arr[], int l, int r, int x)
B.
void binarySearch(int arr[], int x)
C.
int binarySearch(int arr[], int x)
D.
bool binarySearch(int arr[], int l, int r)
Show solution
Solution
The function 'int binarySearch(int arr[], int l, int r, int x)' is a correct implementation signature for binary search, taking the array, left index, right index, and the target value.
Correct Answer:
A
— int binarySearch(int arr[], int l, int r, int x)
Learn More →
Q. Which of the following clustering methods can handle non-spherical clusters?
A.
K-Means
B.
Hierarchical Clustering
C.
DBSCAN
D.
All of the above
Show solution
Solution
DBSCAN can handle non-spherical clusters as it groups points based on density rather than distance.
Correct Answer:
C
— DBSCAN
Learn More →
Q. Which of the following clustering methods can produce non-convex clusters?
A.
K-means
B.
Hierarchical clustering
C.
DBSCAN
D.
Both B and C
Show solution
Solution
Both hierarchical clustering and DBSCAN can produce non-convex clusters, while K-means typically assumes convex shapes.
Correct Answer:
D
— Both B and C
Learn More →
Q. Which of the following clustering methods is best suited for discovering clusters of varying shapes and densities?
A.
K-Means
B.
DBSCAN
C.
Agglomerative Clustering
D.
Gaussian Mixture Models
Show solution
Solution
DBSCAN is effective for discovering clusters of varying shapes and densities.
Correct Answer:
B
— DBSCAN
Learn More →
Q. Which of the following clustering methods is best suited for discovering clusters of arbitrary shapes?
A.
K-Means
B.
DBSCAN
C.
Agglomerative Clustering
D.
Gaussian Mixture Models
Show solution
Solution
DBSCAN is effective for discovering clusters of arbitrary shapes and varying densities.
Correct Answer:
B
— DBSCAN
Learn More →
Q. Which of the following clustering methods is best suited for discovering non-globular shapes in data?
A.
K-means
B.
DBSCAN
C.
Hierarchical clustering
D.
Gaussian Mixture Models
Show solution
Solution
DBSCAN is effective for identifying clusters of varying shapes and densities, making it suitable for non-globular shapes.
Correct Answer:
B
— DBSCAN
Learn More →
Q. Which of the following clustering methods is best suited for discovering non-linear relationships in data?
A.
K-means
B.
Hierarchical clustering
C.
DBSCAN
D.
Gaussian Mixture Models
Show solution
Solution
DBSCAN is effective for discovering non-linear relationships and can identify clusters of varying shapes and sizes, unlike K-means.
Correct Answer:
C
— DBSCAN
Learn More →
Q. Which of the following clustering methods is best suited for discovering non-spherical clusters?
A.
K-means
B.
Hierarchical clustering
C.
DBSCAN
D.
Gaussian Mixture Models
Show solution
Solution
DBSCAN is effective for identifying non-spherical clusters and can handle noise in the data.
Correct Answer:
C
— DBSCAN
Learn More →
Q. Which of the following clustering methods is sensitive to outliers?
A.
K-means
B.
Hierarchical clustering
C.
DBSCAN
D.
Gaussian Mixture Models
Show solution
Solution
K-means is sensitive to outliers because they can significantly affect the position of the centroid, leading to poor clustering results.
Correct Answer:
A
— K-means
Learn More →
Q. Which of the following conditions must be true for binary search to work?
A.
Array must be sorted
B.
Array must be unsorted
C.
Array must contain unique elements
D.
Array must be of fixed size
Show solution
Solution
Binary search requires the array to be sorted in order to function correctly.
Correct Answer:
A
— Array must be sorted
Learn More →
Q. Which of the following data structures allows for dynamic resizing?
A.
Array
B.
Linked List
C.
Stack
D.
Queue
Show solution
Solution
A linked list can grow and shrink dynamically as elements are added or removed, unlike arrays which have a fixed size.
Correct Answer:
B
— Linked List
Learn More →
Q. Which of the following data structures can be efficiently searched using binary search?
A.
Linked List
B.
Stack
C.
Queue
D.
Sorted Array
Show solution
Solution
Binary search is efficient on sorted arrays, as it requires random access to elements.
Correct Answer:
D
— Sorted Array
Learn More →
Q. Which of the following data structures can be used to implement a queue?
A.
Array
B.
Linked List
C.
Stack
D.
Both Array and Linked List
Show solution
Solution
Both arrays and linked lists can be used to implement a queue, as they can both support FIFO operations.
Correct Answer:
D
— Both Array and Linked List
Learn More →
Q. Which of the following data structures can be used to implement binary search efficiently?
A.
Linked List
B.
Array
C.
Stack
D.
Queue
Show solution
Solution
Binary search is most efficiently implemented on an array due to its random access capabilities.
Correct Answer:
B
— Array
Learn More →
Q. Which of the following data structures can be used to implement binary search?
A.
Linked List
B.
Array
C.
Stack
D.
Queue
Show solution
Solution
Binary search is typically implemented on arrays due to their ability to provide random access.
Correct Answer:
B
— Array
Learn More →
Q. Which of the following data structures can binary search be applied to?
A.
Linked lists
B.
Binary trees
C.
Sorted arrays
D.
Hash tables
Show solution
Solution
Binary search is specifically designed for sorted arrays.
Correct Answer:
C
— Sorted arrays
Learn More →
Q. Which of the following data structures is commonly used to implement BFS?
A.
Stack
B.
Queue
C.
Linked List
D.
Array
Show solution
Solution
BFS uses a Queue data structure to keep track of the nodes that need to be explored next.
Correct Answer:
B
— Queue
Learn More →
Q. Which of the following data structures is most efficient for implementing Dijkstra's algorithm?
A.
Array
B.
Linked List
C.
Binary Heap
D.
Stack
Show solution
Solution
A binary heap is the most efficient data structure for implementing Dijkstra's algorithm, as it allows for efficient extraction of the minimum element and updates of the priority queue.
Correct Answer:
C
— Binary Heap
Learn More →
Q. Which of the following data structures is typically used to implement DFS?
A.
Queue
B.
Stack
C.
Array
D.
Linked List
Show solution
Solution
DFS (Depth First Search) is typically implemented using a stack data structure, either explicitly or via recursion.
Correct Answer:
B
— Stack
Learn More →
Q. Which of the following data structures uses LIFO (Last In First Out) principle?
A.
Queue
B.
Stack
C.
Array
D.
Linked List
Show solution
Solution
A stack uses the LIFO principle, meaning the last element added is the first one to be removed.
Correct Answer:
B
— Stack
Learn More →
Q. Which of the following describes a convolutional neural network (CNN)?
A.
A network designed for sequential data
B.
A network that uses convolutional layers for image processing
C.
A network that only uses fully connected layers
D.
A network that does not require any training
Show solution
Solution
CNNs are specifically designed to process and analyze visual data using convolutional layers.
Correct Answer:
B
— A network that uses convolutional layers for image processing
Learn More →
Q. Which of the following distance metrics is commonly used in K-means clustering?
A.
Manhattan distance
B.
Cosine similarity
C.
Euclidean distance
D.
Jaccard index
Show solution
Solution
K-means typically uses Euclidean distance to measure the distance between data points and centroids.
Correct Answer:
C
— Euclidean distance
Learn More →
Q. Which of the following dynamic programming problems can be solved in polynomial time?
A.
Traveling Salesman Problem
B.
Longest Increasing Subsequence
C.
Hamiltonian Path
D.
Graph Coloring
Show solution
Solution
The Longest Increasing Subsequence problem can be solved in polynomial time using dynamic programming.
Correct Answer:
B
— Longest Increasing Subsequence
Learn More →
Q. Which of the following dynamic programming problems can be solved using a bottom-up approach?
A.
Longest Common Subsequence
B.
Fibonacci Sequence
C.
Matrix Chain Multiplication
D.
All of the above
Show solution
Solution
All of the listed problems can be solved using a bottom-up approach in dynamic programming.
Correct Answer:
D
— All of the above
Learn More →
Q. Which of the following fields has seen significant use of SVM?
A.
Healthcare for disease classification
B.
Manufacturing for process optimization
C.
Finance for risk assessment
D.
All of the above
Show solution
Solution
SVM has applications across various fields, including healthcare, manufacturing, and finance.
Correct Answer:
D
— All of the above
Learn More →
Q. Which of the following grammars can be parsed using LL(1) parsing?
A.
Left-recursive grammars
B.
Ambiguous grammars
C.
Non-left-recursive and unambiguous grammars
D.
Context-free grammars only
Show solution
Solution
LL(1) parsing can only be applied to non-left-recursive and unambiguous grammars.
Correct Answer:
C
— Non-left-recursive and unambiguous grammars
Learn More →
Showing 2461 to 2490 of 3237 (108 Pages)