Q. In Dijkstra's algorithm, what data structure is commonly used to select the next node to process?
A.
Stack
B.
Queue
C.
Priority Queue
D.
Array
Show solution
Solution
A priority queue is used in Dijkstra's algorithm to efficiently select the node with the smallest tentative distance.
Correct Answer:
C
— Priority Queue
Learn More →
Q. In Dijkstra's algorithm, what data structure is commonly used to select the next node with the smallest tentative distance?
A.
Array
B.
Stack
C.
Priority Queue
D.
Linked List
Show solution
Solution
A priority queue is used in Dijkstra's algorithm to efficiently retrieve the node with the smallest tentative distance.
Correct Answer:
C
— Priority Queue
Learn More →
Q. In Dijkstra's algorithm, what data structure is primarily used to keep track of the shortest path estimates?
A.
Array
B.
Linked List
C.
Stack
D.
Priority Queue
Show solution
Solution
A priority queue is used in Dijkstra's algorithm to efficiently retrieve the vertex with the smallest distance estimate.
Correct Answer:
D
— Priority Queue
Learn More →
Q. In Dijkstra's algorithm, what data structure is primarily used to keep track of the minimum distance from the source vertex?
A.
Array
B.
Stack
C.
Queue
D.
Priority Queue
Show solution
Solution
A priority queue is used in Dijkstra's algorithm to efficiently retrieve the vertex with the smallest distance from the source.
Correct Answer:
D
— Priority Queue
Learn More →
Q. In Dijkstra's algorithm, what data structure is typically used to keep track of the shortest path estimates?
A.
Array
B.
Linked List
C.
Stack
D.
Priority Queue
Show solution
Solution
A priority queue is used to keep track of the shortest path estimates in Dijkstra's algorithm, allowing efficient retrieval of the next vertex with the smallest distance.
Correct Answer:
D
— Priority Queue
Learn More →
Q. In Dijkstra's algorithm, what does the 'tentative distance' represent?
A.
The actual shortest distance found
B.
The estimated distance to the destination
C.
The distance from the source to the current node
D.
The maximum distance in the graph
Show solution
Solution
The 'tentative distance' represents the current best-known distance from the source node to the current node being processed.
Correct Answer:
C
— The distance from the source to the current node
Learn More →
Q. In Dijkstra's algorithm, what does the priority queue store?
A.
All vertices
B.
Only visited vertices
C.
Only unvisited vertices
D.
Only the shortest path vertices
Show solution
Solution
The priority queue in Dijkstra's algorithm stores only the unvisited vertices, allowing the algorithm to efficiently select the next vertex with the smallest tentative distance.
Correct Answer:
C
— Only unvisited vertices
Learn More →
Q. In Dijkstra's algorithm, what is the purpose of the 'visited' set?
A.
To store all vertices
B.
To keep track of the shortest path
C.
To avoid processing the same vertex multiple times
D.
To store the distances from the source
Show solution
Solution
The 'visited' set is used to keep track of the vertices that have already been processed to avoid processing the same vertex multiple times, ensuring efficiency.
Correct Answer:
C
— To avoid processing the same vertex multiple times
Learn More →
Q. In dynamic programming, what does the term 'overlapping subproblems' mean?
A.
Subproblems that can be solved independently
B.
Subproblems that share sub-subproblems
C.
Subproblems that are never reused
D.
Subproblems that require sorting
Show solution
Solution
Overlapping subproblems refer to subproblems that share sub-subproblems, allowing for reuse of results.
Correct Answer:
B
— Subproblems that share sub-subproblems
Learn More →
Q. In dynamic programming, what does the term 'overlapping subproblems' refer to?
A.
Problems that can be solved in parallel
B.
Subproblems that are solved multiple times
C.
Subproblems that are independent
D.
Problems that require sorting
Show solution
Solution
Overlapping subproblems refer to subproblems that are solved multiple times in the process of solving a larger problem.
Correct Answer:
B
— Subproblems that are solved multiple times
Learn More →
Q. In dynamic programming, what does the term 'state' refer to?
A.
The current value of a variable
B.
A specific subproblem
C.
The final solution
D.
The input size
Show solution
Solution
In dynamic programming, a 'state' refers to a specific subproblem that is being solved.
Correct Answer:
B
— A specific subproblem
Learn More →
Q. In dynamic programming, what is memoization?
A.
A technique to store results of expensive function calls
B.
A method to sort data efficiently
C.
A way to represent data in a tree structure
D.
A technique to optimize space complexity
Show solution
Solution
Memoization is a technique used in dynamic programming to store the results of expensive function calls and reuse them when the same inputs occur again.
Correct Answer:
A
— A technique to store results of expensive function calls
Learn More →
Q. In dynamic programming, what is the 'optimal substructure' property?
A.
The optimal solution can be constructed from optimal solutions of its subproblems
B.
The problem can be solved in linear time
C.
The solution requires sorting the input data
D.
The problem can be solved using a greedy approach
Show solution
Solution
The optimal substructure property means that the optimal solution to a problem can be constructed from the optimal solutions of its subproblems.
Correct Answer:
A
— The optimal solution can be constructed from optimal solutions of its subproblems
Learn More →
Q. In dynamic programming, what is the main advantage of using memoization?
A.
Reduces space complexity
B.
Avoids redundant calculations
C.
Improves sorting speed
D.
Simplifies code structure
Show solution
Solution
Memoization helps avoid redundant calculations by storing the results of expensive function calls.
Correct Answer:
B
— Avoids redundant calculations
Learn More →
Q. In dynamic programming, what is the primary advantage of using a bottom-up approach over a top-down approach?
A.
Easier to implement
B.
Less memory usage
C.
Faster execution time
D.
More intuitive
Show solution
Solution
The bottom-up approach typically uses less memory than the top-down approach because it avoids the overhead of recursive calls.
Correct Answer:
B
— Less memory usage
Learn More →
Q. In dynamic programming, what is the primary purpose of the 'table' or 'array' used?
A.
To store intermediate results
B.
To sort data
C.
To track function calls
D.
To manage memory allocation
Show solution
Solution
The primary purpose of the table or array in dynamic programming is to store intermediate results to avoid redundant calculations.
Correct Answer:
A
— To store intermediate results
Learn More →
Q. In dynamic programming, what is the purpose of a state transition equation?
A.
To define the base case
B.
To describe how to move from one state to another
C.
To optimize the algorithm
D.
To sort the data
Show solution
Solution
A state transition equation describes how to move from one state to another in the dynamic programming solution, defining the relationship between subproblems.
Correct Answer:
B
— To describe how to move from one state to another
Learn More →
Q. In dynamic programming, what is the purpose of memoization?
A.
To sort data
B.
To store intermediate results
C.
To optimize space complexity
D.
To reduce time complexity
Show solution
Solution
Memoization is used to store intermediate results of subproblems to avoid redundant calculations and improve efficiency.
Correct Answer:
B
— To store intermediate results
Learn More →
Q. In dynamic programming, what is the purpose of the 'base case'?
A.
To initialize the DP table
B.
To define the recursive function
C.
To handle edge cases
D.
To optimize the algorithm
Show solution
Solution
The base case is used to initialize the DP table and provide starting values for the recursive relations.
Correct Answer:
A
— To initialize the DP table
Learn More →
Q. In dynamic programming, what is the purpose of the 'state'?
A.
To represent the final solution
B.
To store the results of subproblems
C.
To define the problem constraints
D.
To track the number of iterations
Show solution
Solution
In dynamic programming, the 'state' represents the results of subproblems, which are used to build up the solution to the overall problem.
Correct Answer:
B
— To store the results of subproblems
Learn More →
Q. In dynamic programming, what is the purpose of the 'table' or 'array' used?
A.
To store intermediate results.
B.
To sort the input data.
C.
To keep track of function calls.
D.
To manage memory allocation.
Show solution
Solution
The table or array in dynamic programming is used to store intermediate results of subproblems, which helps in building up the solution to the overall problem.
Correct Answer:
A
— To store intermediate results.
Learn More →
Q. In dynamic programming, what is the purpose of the 'table'?
A.
To store intermediate results
B.
To keep track of function calls
C.
To optimize space complexity
D.
To visualize the algorithm
Show solution
Solution
The 'table' in dynamic programming is used to store intermediate results to avoid redundant calculations.
Correct Answer:
A
— To store intermediate results
Learn More →
Q. In dynamic programming, what is the term for breaking a problem into smaller subproblems?
A.
Memoization
B.
Recursion
C.
Optimal substructure
D.
Overlapping subproblems
Show solution
Solution
Optimal substructure refers to the property that a problem can be broken down into smaller, simpler subproblems.
Correct Answer:
C
— Optimal substructure
Learn More →
Q. In evaluating clustering algorithms, which metric assesses the compactness of clusters?
A.
Silhouette Score
B.
Accuracy
C.
F1 Score
D.
Mean Squared Error
Show solution
Solution
Silhouette Score measures how similar an object is to its own cluster compared to other clusters.
Correct Answer:
A
— Silhouette Score
Learn More →
Q. In feature engineering, what does 'one-hot encoding' achieve?
A.
It reduces the dimensionality of the dataset
B.
It converts categorical variables into a numerical format
C.
It normalizes the data
D.
It increases the number of features exponentially
Show solution
Solution
One-hot encoding transforms categorical variables into a binary matrix, making them suitable for machine learning algorithms.
Correct Answer:
B
— It converts categorical variables into a numerical format
Learn More →
Q. In feature engineering, what does normalization refer to?
A.
Scaling features to a common range
B.
Removing outliers from the dataset
C.
Encoding categorical variables
D.
Selecting important features
Show solution
Solution
Normalization is the process of scaling features to a specific range, often [0, 1].
Correct Answer:
A
— Scaling features to a common range
Learn More →
Q. In finance, neural networks are used for which of the following?
A.
Customer service automation
B.
Fraud detection
C.
Inventory management
D.
Supply chain optimization
Show solution
Solution
Neural networks are effective in fraud detection, analyzing transaction patterns to identify potentially fraudulent activities.
Correct Answer:
B
— Fraud detection
Learn More →
Q. In hierarchical clustering, what does 'agglomerative' mean?
A.
Clusters are formed by splitting larger clusters
B.
Clusters are formed by merging smaller clusters
C.
Clusters are formed randomly
D.
Clusters are formed based on a predefined distance
Show solution
Solution
Agglomerative hierarchical clustering starts with each data point as its own cluster and merges them into larger clusters based on similarity.
Correct Answer:
B
— Clusters are formed by merging smaller clusters
Learn More →
Q. In hierarchical clustering, what does 'agglomerative' refer to?
A.
A method that starts with all points as individual clusters
B.
A method that requires the number of clusters to be predefined
C.
A technique that merges clusters based on distance
D.
A type of clustering that uses a centroid
Show solution
Solution
Agglomerative clustering begins with each data point as its own cluster and merges them iteratively based on distance until a single cluster is formed.
Correct Answer:
A
— A method that starts with all points as individual clusters
Learn More →
Q. In hierarchical clustering, what does agglomerative clustering do?
A.
Starts with all data points as individual clusters and merges them
B.
Starts with one cluster and splits it into smaller clusters
C.
Randomly assigns data points to clusters
D.
Uses a predefined number of clusters
Show solution
Solution
Agglomerative clustering begins with each data point as its own cluster and progressively merges them based on their similarities.
Correct Answer:
A
— Starts with all data points as individual clusters and merges them
Learn More →
Showing 391 to 420 of 3237 (108 Pages)