Q. In a binary tree, what is the maximum number of leaf nodes?
A.
n
B.
n/2
C.
2^(h-1)
D.
2^h
Show solution
Solution
In a binary tree of height h, the maximum number of leaf nodes is 2^(h-1), which occurs in a complete binary tree.
Correct Answer:
C
— 2^(h-1)
Learn More →
Q. In a binary tree, what is the maximum number of nodes at depth d?
A.
d
B.
2^d
C.
2^(d+1) - 1
D.
d^2
Show solution
Solution
The maximum number of nodes at depth d in a binary tree is 2^d.
Correct Answer:
B
— 2^d
Learn More →
Q. In a binary tree, what is the maximum number of nodes at level 'h'?
A.
h
B.
2^h
C.
2^(h+1)-1
D.
h^2
Show solution
Solution
The maximum number of nodes at level 'h' in a binary tree is 2^h.
Correct Answer:
B
— 2^h
Learn More →
Q. In a binary tree, what is the maximum number of nodes at level 'l'?
A.
2^l
B.
l^2
C.
l
D.
2^(l+1)
Show solution
Solution
The maximum number of nodes at level 'l' in a binary tree is 2^l.
Correct Answer:
A
— 2^l
Learn More →
Q. In a binary tree, what is the maximum number of nodes at level k?
A.
k
B.
2^k
C.
2^(k+1)
D.
k^2
Show solution
Solution
In a binary tree, the maximum number of nodes at level k is 2^k, as each node can have two children.
Correct Answer:
B
— 2^k
Learn More →
Q. In a binary tree, what is the minimum number of nodes required to have a height of h?
A.
h
B.
h + 1
C.
2^h
D.
2^(h+1) - 1
Show solution
Solution
The minimum number of nodes required to have a height of h in a binary tree is h, which occurs in a skewed tree.
Correct Answer:
A
— h
Learn More →
Q. In a binary tree, what is the time complexity of finding the height of the tree?
A.
O(n)
B.
O(log n)
C.
O(n log n)
D.
O(1)
Show solution
Solution
The time complexity of finding the height of a binary tree is O(n) because we may need to visit all nodes.
Correct Answer:
A
— O(n)
Learn More →
Q. In a binary tree, what is the time complexity of searching for an element in the worst case?
A.
O(log n)
B.
O(n)
C.
O(n log n)
D.
O(1)
Show solution
Solution
In the worst case, searching for an element in a binary tree can take O(n) time, especially if the tree is unbalanced.
Correct Answer:
B
— O(n)
Learn More →
Q. In a binary tree, what is the time complexity of traversing all nodes using in-order traversal?
A.
O(1)
B.
O(n)
C.
O(log n)
D.
O(n log n)
Show solution
Solution
In-order traversal visits each node exactly once, resulting in a time complexity of O(n).
Correct Answer:
B
— O(n)
Learn More →
Q. In a binary tree, which traversal method is most similar to DFS?
A.
Level-order traversal
B.
In-order traversal
C.
Breadth-first traversal
D.
Random traversal
Show solution
Solution
In-order traversal is a type of DFS as it explores the left subtree, then the node, and finally the right subtree.
Correct Answer:
B
— In-order traversal
Learn More →
Q. In a business context, how can linear regression be applied?
A.
To determine customer segments
B.
To forecast sales based on advertising spend
C.
To classify products into categories
D.
To cluster similar customer behaviors
Show solution
Solution
Linear regression can be used to forecast sales based on advertising spend, predicting continuous outcomes.
Correct Answer:
B
— To forecast sales based on advertising spend
Learn More →
Q. In a case study involving a city map, which application of Dijkstra's algorithm is most relevant?
A.
Finding the fastest route between two locations
B.
Calculating the total distance of all roads
C.
Determining the longest path in the city
D.
Finding all intersections in the map
Show solution
Solution
In a city map scenario, Dijkstra's algorithm is most relevant for finding the fastest route between two locations.
Correct Answer:
A
— Finding the fastest route between two locations
Learn More →
Q. In a case study involving natural language processing, which type of neural network is often used?
A.
Convolutional Neural Network (CNN)
B.
Recurrent Neural Network (RNN)
C.
Feedforward Neural Network
D.
Radial Basis Function Network
Show solution
Solution
Recurrent Neural Networks (RNNs) are commonly used in natural language processing due to their ability to handle sequential data.
Correct Answer:
B
— Recurrent Neural Network (RNN)
Learn More →
Q. In a case study involving predicting house prices, which feature would be most relevant?
A.
The color of the house
B.
The number of bedrooms
C.
The owner's name
D.
The year the house was built
Show solution
Solution
The number of bedrooms is a relevant feature that can significantly impact house prices in a predictive model.
Correct Answer:
B
— The number of bedrooms
Learn More →
Q. In a case study using K-Means clustering, what is a common method to determine the optimal number of clusters?
A.
Cross-validation
B.
Elbow method
C.
Grid search
D.
Random search
Show solution
Solution
The Elbow method helps identify the optimal number of clusters by plotting the explained variance against the number of clusters.
Correct Answer:
B
— Elbow method
Learn More →
Q. In a case study, if a linear regression model has a high R-squared value but a high Mean Squared Error (MSE), what does this suggest?
A.
The model is performing well overall
B.
The model may be overfitting the training data
C.
The model is underfitting the data
D.
The model is perfectly accurate
Show solution
Solution
A high R-squared with high MSE suggests that while the model explains a lot of variance, it may be overfitting the training data and not generalizing well.
Correct Answer:
B
— The model may be overfitting the training data
Learn More →
Q. In a case study, if a linear regression model has a high R-squared value but poor predictive performance on new data, what might be the issue?
A.
The model is too simple
B.
The model is overfitting the training data
C.
The model is underfitting the training data
D.
The data is not linear
Show solution
Solution
A high R-squared value with poor performance on new data suggests that the model may be overfitting, capturing noise rather than the underlying trend.
Correct Answer:
B
— The model is overfitting the training data
Learn More →
Q. In a case study, if a model has high precision but low recall, what does this indicate?
A.
The model is good at identifying positive cases but misses many.
B.
The model is poor at identifying positive cases.
C.
The model has balanced performance.
D.
The model is overfitting.
Show solution
Solution
High precision and low recall indicate that the model is good at identifying positive cases but fails to capture many actual positives.
Correct Answer:
A
— The model is good at identifying positive cases but misses many.
Learn More →
Q. In a case study, if a model's precision is 0.9 and recall is 0.6, what is the F1 score?
A.
0.72
B.
0.75
C.
0.80
D.
0.85
Show solution
Solution
The F1 score is calculated as 2 * (precision * recall) / (precision + recall), which results in 0.72.
Correct Answer:
A
— 0.72
Learn More →
Q. In a case study, SVM was used to classify emails as spam or not spam. What type of learning is this an example of?
A.
Unsupervised learning
B.
Reinforcement learning
C.
Supervised learning
D.
Semi-supervised learning
Show solution
Solution
Classifying emails as spam or not spam is an example of supervised learning, where the model is trained on labeled data.
Correct Answer:
C
— Supervised learning
Learn More →
Q. In a case study, which method is often used to evaluate the effectiveness of feature engineering?
A.
Cross-validation
B.
Data normalization
C.
Hyperparameter tuning
D.
Model deployment
Show solution
Solution
Cross-validation helps assess how well the feature engineering has improved model performance.
Correct Answer:
A
— Cross-validation
Learn More →
Q. In a case study, which method would be best for handling missing values in a dataset?
A.
Drop the rows with missing values
B.
Impute missing values with the mean
C.
Use a neural network to predict missing values
D.
All of the above
Show solution
Solution
All methods can be valid depending on the context and the amount of missing data.
Correct Answer:
D
— All of the above
Learn More →
Q. In a case study, which metric is often used to evaluate the success of a deployed model?
A.
Accuracy
B.
F1 Score
C.
Return on Investment (ROI)
D.
Confusion Matrix
Show solution
Solution
Return on Investment (ROI) is often used to evaluate the success of a deployed model, as it measures the financial benefits gained from the model compared to its costs.
Correct Answer:
C
— Return on Investment (ROI)
Learn More →
Q. In a circular linked list, what is the main characteristic?
A.
Last node points to null
B.
First node points to last node
C.
All nodes are connected in a circle
D.
None of the above
Show solution
Solution
In a circular linked list, the last node points back to the first node, forming a circle.
Correct Answer:
C
— All nodes are connected in a circle
Learn More →
Q. In a circular queue implemented using an array, what is the time complexity of the enqueue operation?
A.
O(1)
B.
O(n)
C.
O(log n)
D.
O(n^2)
Show solution
Solution
The enqueue operation in a circular queue can be performed in constant time O(1) as long as there is space available.
Correct Answer:
A
— O(1)
Learn More →
Q. In a circular queue, what condition indicates that the queue is full?
A.
front == rear
B.
rear == (front + 1) % size
C.
front == (rear + 1) % size
D.
rear == front
Show solution
Solution
In a circular queue, the condition rear == (front + 1) % size indicates that the queue is full, as it means there is no space left for new elements.
Correct Answer:
B
— rear == (front + 1) % size
Learn More →
Q. In a circular queue, what happens when the rear pointer reaches the end of the array?
A.
It resets to the beginning of the array
B.
It stops accepting new elements
C.
It throws an error
D.
It moves to the next available position
Show solution
Solution
In a circular queue, when the rear pointer reaches the end of the array, it resets to the beginning of the array to utilize the available space.
Correct Answer:
A
— It resets to the beginning of the array
Learn More →
Q. In a classification problem, what does a confusion matrix represent?
A.
The relationship between features
B.
The performance of a classification model
C.
The distribution of data points
D.
The training time of the model
Show solution
Solution
A confusion matrix represents the performance of a classification model by showing the true positive, true negative, false positive, and false negative counts.
Correct Answer:
B
— The performance of a classification model
Learn More →
Q. In a classification problem, what does the term 'overfitting' refer to?
A.
The model performs well on training data but poorly on unseen data
B.
The model is too simple to capture the underlying trend
C.
The model has too few features
D.
The model is trained on too much data
Show solution
Solution
Overfitting occurs when a model learns the training data too well, capturing noise and failing to generalize to new data.
Correct Answer:
A
— The model performs well on training data but poorly on unseen data
Learn More →
Q. In a clustering case study, which metric is often used to evaluate the quality of clusters?
A.
Mean Squared Error
B.
Silhouette Score
C.
Accuracy
D.
F1 Score
Show solution
Solution
The Silhouette Score is commonly used to evaluate the quality of clusters by measuring how similar an object is to its own cluster compared to other clusters.
Correct Answer:
B
— Silhouette Score
Learn More →
Showing 211 to 240 of 3237 (108 Pages)