Q. Which of the following properties is true for a Red-Black Tree?
A.
Every node is either red or black
B.
The root is always red
C.
All leaves are red
D.
Red nodes can have red children
Show solution
Solution
In a Red-Black Tree, every node is either red or black, and there are specific properties that maintain balance.
Correct Answer:
A
— Every node is either red or black
Learn More →
Q. Which of the following properties is true for Red-Black trees?
A.
Every node is either red or black
B.
The root must be red
C.
All leaves are black
D.
Both A and C
Show solution
Solution
In Red-Black trees, every node is either red or black, and all leaves (NIL nodes) are black, ensuring balanced properties.
Correct Answer:
D
— Both A and C
Learn More →
Q. Which of the following protocols is used for dynamic IP address allocation?
A.
DHCP
B.
DNS
C.
ARP
D.
ICMP
Show solution
Solution
DHCP (Dynamic Host Configuration Protocol) is used for dynamically allocating IP addresses to devices on a network.
Correct Answer:
A
— DHCP
Learn More →
Q. Which of the following protocols is used for email transmission?
A.
HTTP
B.
FTP
C.
SMTP
D.
SNMP
Show solution
Solution
SMTP (Simple Mail Transfer Protocol) is used for sending emails.
Correct Answer:
C
— SMTP
Learn More →
Q. Which of the following protocols is used for error detection in data transmission?
A.
TCP
B.
UDP
C.
ICMP
D.
ARP
Show solution
Solution
TCP (Transmission Control Protocol) includes mechanisms for error detection and correction in data transmission.
Correct Answer:
A
— TCP
Learn More →
Q. Which of the following protocols is used for secure communication over the web?
A.
HTTP
B.
FTP
C.
HTTPS
D.
SMTP
Show solution
Solution
HTTPS (HTTP Secure) is the protocol used for secure communication over the web, utilizing SSL/TLS for encryption.
Correct Answer:
C
— HTTPS
Learn More →
Q. Which of the following protocols is used for sending emails?
A.
HTTP
B.
FTP
C.
SMTP
D.
SNMP
Show solution
Solution
SMTP (Simple Mail Transfer Protocol) is the protocol used for sending emails.
Correct Answer:
C
— SMTP
Learn More →
Q. Which of the following protocols is used to secure HTTP traffic?
A.
FTP
B.
SMTP
C.
HTTPS
D.
Telnet
Show solution
Solution
HTTPS is the secure version of HTTP, using encryption protocols like SSL/TLS to secure data transmitted over the web.
Correct Answer:
C
— HTTPS
Learn More →
Q. Which of the following protocols is used to send emails?
A.
HTTP
B.
FTP
C.
SMTP
D.
SNMP
Show solution
Solution
SMTP (Simple Mail Transfer Protocol) is used to send emails, while HTTP is used for web traffic.
Correct Answer:
C
— SMTP
Learn More →
Q. Which of the following protocols operates at the Application Layer of the TCP/IP model?
A.
IP
B.
TCP
C.
UDP
D.
DNS
Show solution
Solution
DNS (Domain Name System) operates at the Application Layer of the TCP/IP model.
Correct Answer:
D
— DNS
Learn More →
Q. Which of the following Python functions can be used to implement binary search?
A.
sorted()
B.
bisect.bisect_left()
C.
list.index()
D.
max()
Show solution
Solution
The bisect.bisect_left() function can be used to find the position to insert an element in a sorted list, effectively implementing binary search.
Correct Answer:
B
— bisect.bisect_left()
Learn More →
Q. Which of the following scenarios is a real-world application of binary search?
A.
Finding a name in a phone book
B.
Sorting a list of names
C.
Searching for a file in a directory
D.
Inserting an element in a linked list
Show solution
Solution
Binary search is effectively used for finding a name in a sorted phone book.
Correct Answer:
A
— Finding a name in a phone book
Learn More →
Q. Which of the following scenarios is best suited for hierarchical clustering?
A.
When the number of clusters is known
B.
When the data is high-dimensional
C.
When a hierarchy of clusters is desired
D.
When speed is a priority
Show solution
Solution
Hierarchical clustering is ideal when a hierarchy of clusters is needed, as it provides a detailed view of the data structure.
Correct Answer:
C
— When a hierarchy of clusters is desired
Learn More →
Q. Which of the following scenarios is best suited for K-means clustering?
A.
Identifying customer segments based on purchasing behavior
B.
Classifying emails as spam or not spam
C.
Predicting house prices based on features
D.
Finding the optimal path in a navigation system
Show solution
Solution
K-means clustering is well-suited for identifying customer segments based on similarities in purchasing behavior.
Correct Answer:
A
— Identifying customer segments based on purchasing behavior
Learn More →
Q. Which of the following scenarios is best suited for using a Red-Black tree?
A.
When frequent insertions and deletions are required.
B.
When memory usage is a critical factor.
C.
When the data is static and rarely changes.
D.
When the data needs to be sorted frequently.
Show solution
Solution
Red-Black trees are efficient for scenarios with frequent insertions and deletions due to their balancing properties.
Correct Answer:
A
— When frequent insertions and deletions are required.
Learn More →
Q. Which of the following scenarios is best suited for using a stack?
A.
Processing tasks in the order they arrive
B.
Reversing a string
C.
Searching for an element in a list
D.
Maintaining a sorted list
Show solution
Solution
A stack is best suited for reversing a string, as it allows characters to be pushed and popped in reverse order.
Correct Answer:
B
— Reversing a string
Learn More →
Q. Which of the following scenarios is best suited for using an AVL tree?
A.
When frequent insertions and deletions are expected
B.
When search operations are more frequent than insertions
C.
When memory usage is a critical concern
D.
When the data is mostly static
Show solution
Solution
AVL trees are best suited for scenarios where search operations are frequent, as they maintain balance and ensure O(log n) time complexity for searches.
Correct Answer:
B
— When search operations are more frequent than insertions
Learn More →
Q. Which of the following scenarios is best suited for using Random Forests?
A.
When interpretability is crucial.
B.
When the dataset is small and simple.
C.
When there are many features and complex interactions.
D.
When the output is a continuous variable only.
Show solution
Solution
Random Forests are well-suited for datasets with many features and complex interactions due to their ensemble nature.
Correct Answer:
C
— When there are many features and complex interactions.
Learn More →
Q. Which of the following scenarios is best suited for using SVM?
A.
When the dataset is small and linearly separable
B.
When the dataset is large and contains many outliers
C.
When the dataset is high-dimensional with clear margins of separation
D.
When the dataset is unstructured and requires clustering
Show solution
Solution
SVM performs well in high-dimensional spaces and is effective when there are clear margins of separation between classes.
Correct Answer:
C
— When the dataset is high-dimensional with clear margins of separation
Learn More →
Q. Which of the following scenarios is BFS preferred over DFS?
A.
Finding the shortest path in an unweighted graph
B.
Exploring all possible paths
C.
Finding a cycle in a graph
D.
Topological sorting
Show solution
Solution
BFS is preferred for finding the shortest path in an unweighted graph because it explores all nodes at the present depth before moving deeper.
Correct Answer:
A
— Finding the shortest path in an unweighted graph
Learn More →
Q. Which of the following scenarios is Dijkstra's algorithm best suited for?
A.
Finding the shortest path in a road network
B.
Sorting a list of numbers
C.
Searching for an element in a binary search tree
D.
Finding the maximum flow in a network
Show solution
Solution
Dijkstra's algorithm is particularly effective for finding the shortest path in road networks where edges have non-negative weights.
Correct Answer:
A
— Finding the shortest path in a road network
Learn More →
Q. Which of the following scenarios is K-means clustering NOT suitable for?
A.
When clusters are spherical and evenly sized
B.
When the number of clusters is known
C.
When clusters have varying densities
D.
When outliers are present in the data
Show solution
Solution
K-means is not suitable for clusters with varying densities, as it assumes clusters are spherical and of similar size.
Correct Answer:
C
— When clusters have varying densities
Learn More →
Q. Which of the following scenarios is NOT suitable for binary search?
A.
Searching in a sorted array
B.
Searching in a linked list
C.
Searching in a sorted list
D.
Searching in a sorted tree
Show solution
Solution
Binary search is not suitable for linked lists because it requires random access to elements, which linked lists do not provide.
Correct Answer:
B
— Searching in a linked list
Learn More →
Q. Which of the following scenarios is SVM particularly well-suited for?
A.
Clustering unlabelled data
B.
Classifying linearly separable data
C.
Time series forecasting
D.
Generating synthetic data
Show solution
Solution
SVM is particularly well-suited for classifying linearly separable data, as it can effectively find the optimal separating hyperplane.
Correct Answer:
B
— Classifying linearly separable data
Learn More →
Q. Which of the following scenarios would benefit from using a Red-Black tree?
A.
When frequent insertions and deletions are expected.
B.
When the dataset is static and does not change.
C.
When searching is the only operation performed.
D.
When memory usage is a critical constraint.
Show solution
Solution
Red-Black trees are particularly beneficial in scenarios with frequent insertions and deletions due to their ability to maintain balance efficiently.
Correct Answer:
A
— When frequent insertions and deletions are expected.
Learn More →
Q. Which of the following scenarios would benefit from using an AVL tree over a Red-Black tree?
A.
Frequent insertions and deletions
B.
Frequent lookups
C.
Static data with no modifications
D.
Data with many duplicate values
Show solution
Solution
AVL trees provide faster lookups than Red-Black trees due to their stricter balancing, making them beneficial in scenarios with frequent lookups.
Correct Answer:
B
— Frequent lookups
Learn More →
Q. Which of the following scenarios would NOT be suitable for binary search?
A.
Searching in a sorted array
B.
Searching in a linked list
C.
Searching in a sorted list
D.
Searching in a sorted tree
Show solution
Solution
Binary search is not suitable for linked lists because they do not allow direct access to the middle element.
Correct Answer:
B
— Searching in a linked list
Learn More →
Q. Which of the following scenarios would require a right rotation in an AVL tree?
A.
Left-Left case
B.
Right-Right case
C.
Left-Right case
D.
Right-Left case
Show solution
Solution
A right rotation is required in an AVL tree during a Left-Left case, where a node is inserted into the left subtree of the left child.
Correct Answer:
A
— Left-Left case
Learn More →
Q. Which of the following scenarios would require the use of an alternative to Dijkstra's algorithm?
A.
Finding the shortest path in a road network
B.
Calculating the shortest path in a graph with negative weights
C.
Finding the shortest path in a weighted graph
D.
Finding the shortest path in a tree structure
Show solution
Solution
If the graph contains negative weight edges, an alternative algorithm like Bellman-Ford should be used instead of Dijkstra's.
Correct Answer:
B
— Calculating the shortest path in a graph with negative weights
Learn More →
Q. Which of the following sorting algorithms has the best average time complexity?
A.
Bubble Sort
B.
Insertion Sort
C.
Quick Sort
D.
Selection Sort
Show solution
Solution
Quick Sort has an average time complexity of O(n log n), which is better than the other options listed.
Correct Answer:
C
— Quick Sort
Learn More →
Showing 2941 to 2970 of 3237 (108 Pages)