Q. In an AVL tree, what must be done after an insertion if the tree becomes unbalanced?
A.
Perform a single rotation
B.
Perform a double rotation
C.
Rebuild the entire tree
D.
Nothing is needed
Show solution
Solution
After an insertion, if the AVL tree becomes unbalanced, a double rotation may be required to restore balance.
Correct Answer:
B
— Perform a double rotation
Learn More →
Q. In an AVL tree, what operation is performed when a node becomes unbalanced after an insertion?
A.
Rotation
B.
Traversal
C.
Deletion
D.
Rebalancing
Show solution
Solution
When a node becomes unbalanced after an insertion, a rotation (single or double) is performed to restore balance.
Correct Answer:
A
— Rotation
Learn More →
Q. In an LR parser, what is the purpose of the 'shift' action?
A.
To reduce a production.
B.
To push a state onto the stack.
C.
To pop a state from the stack.
D.
To accept the input.
Show solution
Solution
The 'shift' action in an LR parser moves the next input symbol onto the stack and transitions to a new state.
Correct Answer:
B
— To push a state onto the stack.
Learn More →
Q. In BFS, which node is visited first?
A.
The deepest node
B.
The first node added to the queue
C.
The last node added to the queue
D.
The parent node
Show solution
Solution
In BFS, the first node added to the queue is visited first, as BFS explores all neighbors at the present depth prior to moving on to nodes at the next depth level.
Correct Answer:
B
— The first node added to the queue
Learn More →
Q. In binary search, how do you calculate the middle index?
A.
(low + high) / 2
B.
(low + high) / 2 + 1
C.
(low + high) / 2 - 1
D.
low + (high - low) / 2
Show solution
Solution
The middle index is calculated using low + (high - low) / 2 to avoid overflow.
Correct Answer:
D
— low + (high - low) / 2
Learn More →
Q. In binary search, if the target is less than the middle element, what should be the next step?
A.
Search the right half
B.
Search the left half
C.
Return the middle element
D.
Increase the middle index
Show solution
Solution
If the target is less than the middle element, the next step is to search the left half of the array.
Correct Answer:
B
— Search the left half
Learn More →
Q. In binary search, if the target value is not found, what will be the return value?
A.
-1
B.
0
C.
null
D.
the index of the closest value
Show solution
Solution
Typically, binary search returns -1 to indicate that the target value is not present in the array.
Correct Answer:
A
— -1
Learn More →
Q. In binary search, what happens if the middle element is greater than the target?
A.
Search the left half
B.
Search the right half
C.
Search both halves
D.
Return the middle element
Show solution
Solution
If the middle element is greater than the target, the search continues in the left half of the array.
Correct Answer:
A
— Search the left half
Learn More →
Q. In binary search, what happens to the search space after each comparison?
A.
It doubles
B.
It halves
C.
It remains the same
D.
It increases linearly
Show solution
Solution
After each comparison, the search space is halved, which is the key to its efficiency.
Correct Answer:
B
— It halves
Learn More →
Q. In binary search, what is the formula to find the middle index?
A.
(low + high) / 2
B.
(low + high) / 2 + 1
C.
(low + high) / 2 - 1
D.
low + high
Show solution
Solution
The middle index is calculated using (low + high) / 2.
Correct Answer:
A
— (low + high) / 2
Learn More →
Q. In binary search, what is the purpose of calculating the mid index?
A.
To find the maximum element
B.
To divide the array into two halves
C.
To check for duplicates
D.
To sort the array
Show solution
Solution
The mid index is calculated to divide the array into two halves for further searching.
Correct Answer:
B
— To divide the array into two halves
Learn More →
Q. In CIDR notation, what does /16 signify?
A.
255.255.0.0 subnet mask
B.
65,536 possible addresses
C.
A Class B network
D.
All of the above
Show solution
Solution
CIDR notation /16 indicates a subnet mask of 255.255.0.0, allowing for 65,536 possible addresses, typically associated with Class B networks.
Correct Answer:
D
— All of the above
Learn More →
Q. In CIDR notation, what does /24 represent?
A.
255.255.255.0 subnet mask
B.
256 IP addresses
C.
24 hosts per subnet
D.
24 bits for the host portion
Show solution
Solution
CIDR notation /24 indicates that the first 24 bits of the subnet mask are set to 1, which corresponds to a subnet mask of 255.255.255.0.
Correct Answer:
A
— 255.255.255.0 subnet mask
Learn More →
Q. In CIDR notation, what does a /22 subnet mask indicate?
A.
255.255.252.0
B.
255.255.255.0
C.
255.255.255.252
D.
255.255.255.128
Show solution
Solution
A /22 subnet mask corresponds to 255.255.252.0, allowing for 1024 IP addresses in the subnet.
Correct Answer:
A
— 255.255.252.0
Learn More →
Q. In CIDR notation, what does a /24 subnet indicate?
A.
255.255.255.0
B.
255.255.0.0
C.
255.0.0.0
D.
255.255.255.255
Show solution
Solution
CIDR notation /24 corresponds to a subnet mask of 255.255.255.0, which allows for 256 addresses in the subnet.
Correct Answer:
A
— 255.255.255.0
Learn More →
Q. In CIDR notation, what does a /24 subnet mask represent?
A.
255.255.255.0
B.
255.255.0.0
C.
255.0.0.0
D.
255.255.255.255
Show solution
Solution
A /24 subnet mask corresponds to 255.255.255.0, allowing for 256 IP addresses in the subnet.
Correct Answer:
A
— 255.255.255.0
Learn More →
Q. In classification problems, what does the F1 Score represent?
A.
The harmonic mean of precision and recall
B.
The average of precision and recall
C.
The total number of true positives
D.
The ratio of true positives to total predictions
Show solution
Solution
The F1 Score is the harmonic mean of precision and recall, providing a balance between the two metrics.
Correct Answer:
A
— The harmonic mean of precision and recall
Learn More →
Q. In classification problems, what does the term 'class label' refer to?
A.
The input features of the data
B.
The predicted output category
C.
The algorithm used for training
D.
The evaluation metric
Show solution
Solution
The class label refers to the predicted output category in classification problems.
Correct Answer:
B
— The predicted output category
Learn More →
Q. In classification tasks, what does precision measure?
A.
True positives over total positives
B.
True positives over total predicted positives
C.
True positives over total actual positives
D.
True negatives over total negatives
Show solution
Solution
Precision measures the ratio of true positives to the total predicted positives, indicating the accuracy of positive predictions.
Correct Answer:
B
— True positives over total predicted positives
Learn More →
Q. In classification tasks, what does the F1 Score represent?
A.
The harmonic mean of precision and recall
B.
The average of precision and recall
C.
The total number of true positives
D.
The ratio of true positives to total predictions
Show solution
Solution
The F1 Score is the harmonic mean of precision and recall, providing a balance between the two metrics.
Correct Answer:
A
— The harmonic mean of precision and recall
Learn More →
Q. In DBSCAN, what does the term 'epsilon' refer to?
A.
The minimum number of points required to form a cluster
B.
The maximum distance between two points to be considered in the same cluster
C.
The number of clusters to form
D.
The density of the clusters
Show solution
Solution
'Epsilon' defines the maximum distance between two points for them to be considered part of the same cluster in DBSCAN.
Correct Answer:
B
— The maximum distance between two points to be considered in the same cluster
Learn More →
Q. In Decision Trees, what does the Gini impurity measure?
A.
The accuracy of the model
B.
The purity of a node
C.
The depth of the tree
D.
The number of features used
Show solution
Solution
Gini impurity measures the impurity or disorder of a node, helping to determine the best split at each node.
Correct Answer:
B
— The purity of a node
Learn More →
Q. In Depth-First Search (DFS), which data structure is primarily used to keep track of the vertices to be explored?
A.
Queue
B.
Stack
C.
Array
D.
Linked List
Show solution
Solution
DFS uses a stack (either explicitly or via recursion) to keep track of the vertices.
Correct Answer:
B
— Stack
Learn More →
Q. In Depth-First Search (DFS), which data structure is primarily used?
A.
Queue
B.
Stack
C.
Array
D.
Hash Table
Show solution
Solution
DFS uses a stack to keep track of the nodes to be explored, either explicitly or through recursion.
Correct Answer:
B
— Stack
Learn More →
Q. In DFS, what is the maximum depth of recursion for a graph with V vertices?
A.
O(V)
B.
O(E)
C.
O(V + E)
D.
O(log V)
Show solution
Solution
The maximum depth of recursion in DFS can go up to O(V) in the worst case, where V is the number of vertices.
Correct Answer:
A
— O(V)
Learn More →
Q. In DFS, what is the primary data structure used?
A.
Queue
B.
Stack
C.
Array
D.
Hash Table
Show solution
Solution
DFS uses a Stack data structure, either explicitly or through recursion, to keep track of the nodes to be explored.
Correct Answer:
B
— Stack
Learn More →
Q. In Dijkstra's algorithm, how is the next node to process selected?
A.
By selecting the node with the highest degree
B.
By selecting the node with the lowest tentative distance
C.
By selecting the node that was added last
D.
By selecting a random node
Show solution
Solution
The next node to process in Dijkstra's algorithm is selected based on the lowest tentative distance, ensuring the shortest path is explored first.
Correct Answer:
B
— By selecting the node with the lowest tentative distance
Learn More →
Q. In Dijkstra's algorithm, what condition must be met for a vertex to be added to the set of visited vertices?
A.
It must have the smallest edge weight
B.
It must be the last vertex processed
C.
It must be connected to the source
D.
It must have the highest degree
Show solution
Solution
In Dijkstra's algorithm, a vertex is added to the set of visited vertices when it has the smallest tentative distance from the source vertex.
Correct Answer:
A
— It must have the smallest edge weight
Learn More →
Q. In Dijkstra's algorithm, what data structure is commonly used to keep track of the nodes to be explored?
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 next 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 keep track of the minimum distance to each vertex?
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 vertex with the smallest distance.
Correct Answer:
C
— Priority Queue
Learn More →
Showing 361 to 390 of 3237 (108 Pages)