Q. Which algorithm can be used as an alternative to Dijkstra's algorithm for graphs with negative weights?
A.
Prim's algorithm
B.
Kruskal's algorithm
C.
Bellman-Ford algorithm
D.
A* algorithm
Show solution
Solution
The Bellman-Ford algorithm can be used to find the shortest paths in graphs with negative weight edges.
Correct Answer:
C
— Bellman-Ford algorithm
Learn More →
Q. Which algorithm can be used instead of Dijkstra's algorithm for graphs with negative weights?
A.
A* Search Algorithm
B.
Bellman-Ford Algorithm
C.
Floyd-Warshall Algorithm
D.
Depth-First Search
Show solution
Solution
The Bellman-Ford algorithm can be used for graphs with negative weights, as it can correctly find the shortest paths even in such cases.
Correct Answer:
B
— Bellman-Ford Algorithm
Learn More →
Q. Which algorithm can be used to detect cycles in a directed graph?
A.
BFS
B.
DFS
C.
Dijkstra's Algorithm
D.
Prim's Algorithm
Show solution
Solution
DFS can be used to detect cycles in a directed graph by keeping track of visited nodes and the recursion stack.
Correct Answer:
B
— DFS
Learn More →
Q. Which algorithm can be used to find the shortest path in a graph with negative weights?
A.
Dijkstra's Algorithm
B.
Bellman-Ford Algorithm
C.
A* Search Algorithm
D.
Floyd-Warshall Algorithm
Show solution
Solution
The Bellman-Ford algorithm can handle graphs with negative weights and can also detect negative cycles.
Correct Answer:
B
— Bellman-Ford Algorithm
Learn More →
Q. Which algorithm is a better choice than Dijkstra's for graphs with negative edge weights?
A.
A* Search Algorithm
B.
Bellman-Ford Algorithm
C.
Floyd-Warshall Algorithm
D.
Depth-First Search
Show solution
Solution
The Bellman-Ford algorithm is a better choice than Dijkstra's for graphs with negative edge weights, as it can handle them correctly.
Correct Answer:
B
— Bellman-Ford Algorithm
Learn More →
Q. Which algorithm is an example of dynamic programming used for optimization?
A.
Dijkstra's algorithm
B.
Bellman-Ford algorithm
C.
Floyd-Warshall algorithm
D.
All of the above
Show solution
Solution
The Floyd-Warshall algorithm is an example of dynamic programming used for finding the shortest paths in a weighted graph.
Correct Answer:
C
— Floyd-Warshall algorithm
Learn More →
Q. Which algorithm is best suited for finding connected components in a graph?
A.
BFS
B.
DFS
C.
Dijkstra's Algorithm
D.
A* Search
Show solution
Solution
DFS is often used to find connected components in a graph by exploring all reachable nodes from a starting node.
Correct Answer:
B
— DFS
Learn More →
Q. Which algorithm is better for finding connected components in a graph?
A.
BFS
B.
DFS
C.
Both are equally good
D.
None of the above
Show solution
Solution
Both BFS and DFS can be used to find connected components in a graph, and they are equally effective for this purpose.
Correct Answer:
C
— Both are equally good
Learn More →
Q. Which algorithm is commonly associated with reinforcement learning?
A.
K-Means Clustering
B.
Q-Learning
C.
Linear Regression
D.
Principal Component Analysis
Show solution
Solution
Q-Learning is a widely used algorithm in reinforcement learning that helps the agent learn the value of actions in different states.
Correct Answer:
B
— Q-Learning
Learn More →
Q. Which algorithm is commonly used for binary classification problems?
A.
K-Means Clustering
B.
Linear Regression
C.
Logistic Regression
D.
Principal Component Analysis
Show solution
Solution
Logistic Regression is a widely used algorithm for binary classification tasks, modeling the probability of a binary outcome.
Correct Answer:
C
— Logistic Regression
Learn More →
Q. Which algorithm is commonly used for binary classification tasks?
A.
Linear Regression
B.
Logistic Regression
C.
K-Means Clustering
D.
Principal Component Analysis
Show solution
Solution
Logistic Regression is commonly used for binary classification tasks, as it models the probability of a binary outcome.
Correct Answer:
B
— Logistic Regression
Learn More →
Q. Which algorithm is commonly used for classification tasks?
A.
Linear Regression
B.
K-Nearest Neighbors
C.
Principal Component Analysis
D.
K-Means Clustering
Show solution
Solution
K-Nearest Neighbors (KNN) is a popular algorithm used for classification tasks, where it classifies data points based on the classes of their nearest neighbors.
Correct Answer:
B
— K-Nearest Neighbors
Learn More →
Q. Which algorithm is commonly used for clustering?
A.
Linear Regression
B.
K-Means
C.
Support Vector Machine
D.
Decision Tree
Show solution
Solution
K-Means is a popular algorithm used for clustering, grouping data points into clusters based on similarity.
Correct Answer:
B
— K-Means
Learn More →
Q. Which algorithm is commonly used for linear regression?
A.
K-Nearest Neighbors
B.
Support Vector Machines
C.
Ordinary Least Squares
D.
Decision Trees
Show solution
Solution
Ordinary Least Squares (OLS) is a method used to estimate the parameters in linear regression by minimizing the sum of the squares of the residuals.
Correct Answer:
C
— Ordinary Least Squares
Learn More →
Q. Which algorithm is commonly used for multi-class classification problems?
A.
Support Vector Machines
B.
K-Means Clustering
C.
Linear Regression
D.
Decision Trees
Show solution
Solution
Decision Trees are commonly used for multi-class classification problems, as they can handle multiple classes effectively.
Correct Answer:
D
— Decision Trees
Learn More →
Q. Which algorithm is guaranteed to find the shortest path in a graph with negative weight edges?
A.
Dijkstra's algorithm
B.
A* algorithm
C.
Bellman-Ford algorithm
D.
Floyd-Warshall algorithm
Show solution
Solution
The Bellman-Ford algorithm is guaranteed to find the shortest path in graphs with negative weight edges, unlike Dijkstra's algorithm.
Correct Answer:
C
— Bellman-Ford algorithm
Learn More →
Q. Which algorithm is more memory efficient for deep graphs?
A.
BFS
B.
DFS
C.
Both are equal
D.
Neither is efficient
Show solution
Solution
DFS is generally more memory efficient for deep graphs because it uses a stack and does not need to store all nodes at the current level like BFS does.
Correct Answer:
B
— DFS
Learn More →
Q. Which algorithm is more memory efficient for large graphs?
A.
BFS
B.
DFS
C.
Both are equally efficient
D.
Neither is efficient
Show solution
Solution
DFS is generally more memory efficient for large graphs because it uses less memory than BFS, which stores all nodes at the current level.
Correct Answer:
B
— DFS
Learn More →
Q. Which algorithm is more suitable for finding the shortest path in a graph with negative weights?
A.
Dijkstra's Algorithm
B.
Bellman-Ford Algorithm
C.
A* Search Algorithm
D.
Floyd-Warshall Algorithm
Show solution
Solution
The Bellman-Ford algorithm is suitable for finding the shortest path in graphs with negative weights.
Correct Answer:
B
— Bellman-Ford Algorithm
Learn More →
Q. Which algorithm is primarily used for regression tasks in Decision Trees?
A.
CART (Classification and Regression Trees)
B.
ID3
C.
C4.5
D.
K-Means
Show solution
Solution
CART (Classification and Regression Trees) is used for both classification and regression tasks in Decision Trees.
Correct Answer:
A
— CART (Classification and Regression Trees)
Learn More →
Q. Which algorithm is typically faster for making predictions, Decision Trees or Random Forests?
A.
Decision Trees
B.
Random Forests
C.
Both are equally fast
D.
It depends on the dataset size
Show solution
Solution
Decision Trees are generally faster for making predictions because they involve a single tree, while Random Forests require aggregating results from multiple trees.
Correct Answer:
A
— Decision Trees
Learn More →
Q. Which algorithm is typically faster for making predictions?
A.
Decision Trees
B.
Random Forests
C.
Support Vector Machines
D.
Neural Networks
Show solution
Solution
Decision Trees are typically faster for making predictions because they involve traversing a single tree structure.
Correct Answer:
A
— Decision Trees
Learn More →
Q. Which algorithm is typically faster to train on large datasets?
A.
Decision Trees
B.
Random Forests
C.
Both are equally fast
D.
Neither, both are slow
Show solution
Solution
Decision Trees are generally faster to train than Random Forests, as Random Forests require training multiple trees.
Correct Answer:
A
— Decision Trees
Learn More →
Q. Which algorithm is typically used for binary classification tasks?
A.
K-Means Clustering
B.
Linear Regression
C.
Logistic Regression
D.
Principal Component Analysis
Show solution
Solution
Logistic Regression is commonly used for binary classification tasks as it models the probability of a binary outcome.
Correct Answer:
C
— Logistic Regression
Learn More →
Q. Which algorithm is typically used for binary classification?
A.
K-Means Clustering
B.
Linear Regression
C.
Logistic Regression
D.
Principal Component Analysis
Show solution
Solution
Logistic Regression is commonly used for binary classification tasks, predicting probabilities of class membership.
Correct Answer:
C
— Logistic Regression
Learn More →
Q. Which algorithm is typically used for both regression and classification tasks?
A.
K-Nearest Neighbors
B.
Naive Bayes
C.
Random Forest
D.
Principal Component Analysis
Show solution
Solution
Random Forest can be used for both regression and classification tasks, making it versatile.
Correct Answer:
C
— Random Forest
Learn More →
Q. Which algorithm is typically used for finding connected components in a graph?
A.
Dijkstra's Algorithm
B.
Prim's Algorithm
C.
BFS or DFS
D.
Kruskal's Algorithm
Show solution
Solution
BFS or DFS is typically used for finding connected components in a graph.
Correct Answer:
C
— BFS or DFS
Learn More →
Q. Which algorithm is typically used for finding the shortest path in a weighted graph?
A.
DFS
B.
BFS
C.
Dijkstra's Algorithm
D.
Prim's Algorithm
Show solution
Solution
Dijkstra's Algorithm is used for finding the shortest path in a weighted graph.
Correct Answer:
C
— Dijkstra's Algorithm
Learn More →
Q. Which algorithm is typically used for linear regression?
A.
K-Nearest Neighbors
B.
Support Vector Machines
C.
Ordinary Least Squares
D.
Decision Trees
Show solution
Solution
Ordinary Least Squares (OLS) is a common algorithm used for linear regression to minimize the sum of squared differences between observed and predicted values.
Correct Answer:
C
— Ordinary Least Squares
Learn More →
Q. Which algorithm is typically used for multi-class classification problems?
A.
Logistic Regression
B.
K-Nearest Neighbors
C.
Linear Regression
D.
Principal Component Analysis
Show solution
Solution
K-Nearest Neighbors can be used for multi-class classification by assigning the class based on the majority vote of neighbors.
Correct Answer:
B
— K-Nearest Neighbors
Learn More →
Showing 2101 to 2130 of 3237 (108 Pages)