Q. What is the function of a default gateway in a network?
A.
To connect devices within the same subnet
B.
To route traffic to external networks
C.
To assign IP addresses dynamically
D.
To filter network traffic
Show solution
Solution
A default gateway routes traffic from a local network to external networks, allowing devices to communicate outside their subnet.
Correct Answer:
B
— To route traffic to external networks
Learn More →
Q. What is the function of a default gateway in a subnet?
A.
To route traffic within the subnet
B.
To connect to the internet
C.
To assign IP addresses
D.
To manage network security
Show solution
Solution
The default gateway is used to route traffic from a local subnet to destinations outside the subnet, typically to the internet.
Correct Answer:
B
— To connect to the internet
Learn More →
Q. What is the function of a router in a network?
A.
To connect devices within the same local area network
B.
To forward data packets between different networks
C.
To provide a wireless connection
D.
To manage IP address assignments
Show solution
Solution
A router forwards data packets between different networks, making it essential for inter-network communication.
Correct Answer:
B
— To forward data packets between different networks
Learn More →
Q. What is the function of the 'Content-Type' header in an HTTP response?
A.
To specify the server type
B.
To indicate the type of content being sent
C.
To define the encoding type
D.
To manage cache settings
Show solution
Solution
The 'Content-Type' header in an HTTP response indicates the media type of the resource being sent, allowing the client to understand how to process it.
Correct Answer:
B
— To indicate the type of content being sent
Learn More →
Q. What is the Gini impurity used for in Decision Trees?
A.
To measure the accuracy of the model
B.
To determine the best split at each node
C.
To evaluate the performance of Random Forests
D.
To select features for the model
Show solution
Solution
Gini impurity is used to determine the best split at each node in a Decision Tree, helping to create more homogeneous child nodes.
Correct Answer:
B
— To determine the best split at each node
Learn More →
Q. What is the height of a balanced binary tree with n nodes?
A.
O(n)
B.
O(log n)
C.
O(n log n)
D.
O(1)
Show solution
Solution
The height of a balanced binary tree with n nodes is O(log n).
Correct Answer:
B
— O(log n)
Learn More →
Q. What is the height of a binary tree with a single node?
A.
0
B.
1
C.
2
D.
Depends on the number of children
Show solution
Solution
The height of a binary tree with a single node is 0, as height is defined as the number of edges on the longest path from the node to a leaf.
Correct Answer:
A
— 0
Learn More →
Q. What is the height of a binary tree with n nodes 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, the height of a binary tree with n nodes can be O(n), which occurs when the tree is skewed.
Correct Answer:
B
— O(n)
Learn More →
Q. What is the height of a binary tree with only one node?
A.
0
B.
1
C.
2
D.
It cannot be determined
Show solution
Solution
The height of a binary tree with only one node is 0, as height is defined as the number of edges on the longest path from the root to a leaf.
Correct Answer:
A
— 0
Learn More →
Q. What is the height of a complete binary tree with n nodes?
A.
log(n)
B.
n
C.
log(n + 1)
D.
n/2
Show solution
Solution
The height of a complete binary tree with n nodes is log(n + 1).
Correct Answer:
C
— log(n + 1)
Learn More →
Q. What is the initial distance value assigned to the source vertex in Dijkstra's algorithm?
A.
Infinity
B.
0
C.
1
D.
Negative Infinity
Show solution
Solution
The initial distance value assigned to the source vertex is 0, as it is the starting point of the path.
Correct Answer:
B
— 0
Learn More →
Q. What is the initial value assigned to the tentative distance of the source node in Dijkstra's algorithm?
A.
Infinity
B.
Zero
C.
One
D.
Negative infinity
Show solution
Solution
The tentative distance of the source node is initialized to zero, as it is the starting point of the path.
Correct Answer:
B
— Zero
Learn More →
Q. What is the initial value of the tentative distance for the source node in Dijkstra's algorithm?
A.
Infinity
B.
0
C.
1
D.
The weight of the first edge
Show solution
Solution
The initial value of the tentative distance for the source node is set to 0, as it is the starting point.
Correct Answer:
B
— 0
Learn More →
Q. What is the key difference between greedy algorithms and dynamic programming?
A.
Greedy algorithms use recursion
B.
Dynamic programming considers all possible solutions
C.
Greedy algorithms are always optimal
D.
Dynamic programming is faster
Show solution
Solution
The key difference is that dynamic programming considers all possible solutions, while greedy algorithms make local optimal choices.
Correct Answer:
B
— Dynamic programming considers all possible solutions
Learn More →
Q. What is the last valid host address in the subnet 10.0.0.0/8?
A.
10.0.0.255
B.
10.255.255.254
C.
10.0.0.0
D.
10.255.255.255
Show solution
Solution
In the subnet 10.0.0.0/8, the last valid host address is 10.255.255.254, as 10.255.255.255 is the broadcast address.
Correct Answer:
B
— 10.255.255.254
Learn More →
Q. What is the level order traversal of the binary tree with root node value 1, left child 2, and right child 3?
A.
[1, 2, 3]
B.
[2, 1, 3]
C.
[1, 3, 2]
D.
[3, 2, 1]
Show solution
Solution
The level order traversal visits nodes level by level, resulting in [1, 2, 3].
Correct Answer:
A
— [1, 2, 3]
Learn More →
Q. What is the level-order traversal of a binary tree with root A, left child B, and right child C?
A.
A, B, C
B.
B, A, C
C.
C, B, A
D.
A, C, B
Show solution
Solution
In level-order traversal, nodes are visited level by level from top to bottom, resulting in A, B, C.
Correct Answer:
A
— A, B, C
Learn More →
Q. What is the level-order traversal of a binary tree?
A.
Visit nodes from top to bottom, left to right
B.
Visit nodes from bottom to top, right to left
C.
Visit nodes in in-order
D.
Visit nodes in pre-order
Show solution
Solution
Level-order traversal visits nodes from top to bottom and left to right.
Correct Answer:
A
— Visit nodes from top to bottom, left to right
Learn More →
Q. What is the main advantage of binary search over linear search?
A.
It is easier to implement
B.
It works on unsorted arrays
C.
It has a better time complexity
D.
It requires less memory
Show solution
Solution
Binary search has a time complexity of O(log n), which is significantly better than the O(n) of linear search.
Correct Answer:
C
— It has a better time complexity
Learn More →
Q. What is the main advantage of Dijkstra's algorithm over the Bellman-Ford algorithm?
A.
It can handle negative weights
B.
It is faster for graphs with non-negative weights
C.
It is simpler to implement
D.
It can find all pairs shortest paths
Show solution
Solution
Dijkstra's algorithm is generally faster than the Bellman-Ford algorithm for graphs with non-negative weights.
Correct Answer:
B
— It is faster for graphs with non-negative weights
Learn More →
Q. What is the main advantage of hierarchical clustering over K-means?
A.
It does not require the number of clusters to be specified in advance
B.
It is faster and more efficient
C.
It can handle larger datasets
D.
It is less sensitive to outliers
Show solution
Solution
Hierarchical clustering does not require the number of clusters to be predetermined, allowing for more flexibility in analysis.
Correct Answer:
A
— It does not require the number of clusters to be specified in advance
Learn More →
Q. What is the main advantage of hierarchical clustering?
A.
It requires a predefined number of clusters
B.
It can produce a dendrogram for visualizing clusters
C.
It is faster than K-Means
D.
It is less sensitive to noise
Show solution
Solution
Hierarchical clustering creates a dendrogram, which provides a visual representation of the data's clustering structure.
Correct Answer:
B
— It can produce a dendrogram for visualizing clusters
Learn More →
Q. What is the main advantage of using a balanced tree over an unbalanced tree?
A.
Easier to implement
B.
Faster operations due to reduced height
C.
Less memory usage
D.
More complex algorithms
Show solution
Solution
Balanced trees have reduced height compared to unbalanced trees, leading to faster operations such as search, insert, and delete.
Correct Answer:
B
— Faster operations due to reduced height
Learn More →
Q. What is the main advantage of using a binary tree over an array for dynamic data?
A.
Faster access times
B.
Easier to implement
C.
Dynamic size
D.
Less memory usage
Show solution
Solution
Binary trees can grow and shrink dynamically, allowing for efficient insertions and deletions, unlike arrays which have a fixed size.
Correct Answer:
C
— Dynamic size
Learn More →
Q. What is the main advantage of using a deque over a regular queue?
A.
Faster access time
B.
Ability to add/remove from both ends
C.
Less memory usage
D.
Easier implementation
Show solution
Solution
A deque (double-ended queue) allows for adding and removing elements from both ends, providing more flexibility than a regular queue.
Correct Answer:
B
— Ability to add/remove from both ends
Learn More →
Q. What is the main advantage of using a dynamic array over a static array?
A.
Faster access
B.
Fixed size
C.
Dynamic resizing
D.
Less memory usage
Show solution
Solution
Dynamic arrays can resize themselves when they reach capacity, allowing for more flexible memory usage.
Correct Answer:
C
— Dynamic resizing
Learn More →
Q. What is the main advantage of using a Fibonacci heap in Dijkstra's algorithm?
A.
It simplifies the implementation
B.
It reduces the time complexity to O(E + V log V)
C.
It allows for negative weights
D.
It uses less memory
Show solution
Solution
Using a Fibonacci heap can reduce the time complexity of Dijkstra's algorithm to O(E + V log V), making it more efficient for dense graphs.
Correct Answer:
B
— It reduces the time complexity to O(E + V log V)
Learn More →
Q. What is the main advantage of using a Fibonacci heap with Dijkstra's algorithm?
A.
It reduces the space complexity.
B.
It improves the time complexity for decrease-key operations.
C.
It allows for negative weights.
D.
It simplifies the implementation.
Show solution
Solution
Using a Fibonacci heap improves the time complexity for decrease-key operations, making Dijkstra's algorithm more efficient.
Correct Answer:
B
— It improves the time complexity for decrease-key operations.
Learn More →
Q. What is the main advantage of using a linked list over an array?
A.
Faster access time
B.
Dynamic size
C.
Better memory locality
D.
Easier to sort
Show solution
Solution
Linked lists can grow and shrink in size dynamically, unlike arrays which have a fixed size.
Correct Answer:
B
— Dynamic size
Learn More →
Q. What is the main advantage of using a priority queue in Dijkstra's algorithm?
A.
It allows for faster insertion of nodes
B.
It ensures that the node with the smallest distance is processed next
C.
It reduces the space complexity
D.
It simplifies the implementation
Show solution
Solution
Using a priority queue allows Dijkstra's algorithm to efficiently retrieve and process the node with the smallest tentative distance next.
Correct Answer:
B
— It ensures that the node with the smallest distance is processed next
Learn More →
Showing 1081 to 1110 of 3237 (108 Pages)