Q. What is the primary data structure used in the implementation of Heap Sort?
A.
Array
B.
Linked List
C.
Stack
D.
Queue
Show solution
Solution
Heap Sort primarily uses an array to represent the binary heap structure.
Correct Answer:
A
— Array
Learn More →
Q. What is the primary data structure used to implement a queue for level order traversal?
A.
Stack
B.
Array
C.
Linked List
D.
Queue
Show solution
Solution
A queue is the primary data structure used to implement level order traversal of a binary tree.
Correct Answer:
D
— Queue
Learn More →
Q. What is the primary difference between a stack and a queue?
A.
Stack is LIFO, Queue is FIFO
B.
Stack is FIFO, Queue is LIFO
C.
Both are LIFO
D.
Both are FIFO
Show solution
Solution
A stack follows Last In First Out (LIFO) order, while a queue follows First In First Out (FIFO) order.
Correct Answer:
A
— Stack is LIFO, Queue is FIFO
Learn More →
Q. What is the primary difference between BFS and DFS in graph traversal?
A.
BFS uses a stack, while DFS uses a queue.
B.
BFS explores all neighbors at the present depth before moving on, while DFS explores as far as possible along a branch.
C.
BFS is faster than DFS in all cases.
D.
DFS is used for finding the shortest path, while BFS is not.
Show solution
Solution
BFS explores all neighbors at the present depth before moving on, while DFS explores as far as possible along a branch.
Correct Answer:
B
— BFS explores all neighbors at the present depth before moving on, while DFS explores as far as possible along a branch.
Learn More →
Q. What is the primary difference between BFS and DFS in terms of traversal strategy?
A.
BFS uses a queue, DFS uses a stack
B.
BFS uses a stack, DFS uses a queue
C.
BFS is faster than DFS
D.
DFS is always more memory efficient
Show solution
Solution
BFS uses a queue to explore nodes level by level, while DFS uses a stack (or recursion) to explore as far as possible along each branch before backtracking.
Correct Answer:
A
— BFS uses a queue, DFS uses a stack
Learn More →
Q. What is the primary difference between BFS and DFS?
A.
BFS uses a stack, DFS uses a queue
B.
BFS explores nodes level by level, DFS explores as far as possible along a branch
C.
BFS is faster than DFS
D.
DFS is always more memory efficient than BFS
Show solution
Solution
The primary difference is that BFS explores nodes level by level, while DFS explores as far as possible along a branch before backtracking.
Correct Answer:
B
— BFS explores nodes level by level, DFS explores as far as possible along a branch
Learn More →
Q. What is the primary difference between Dijkstra's algorithm and the A* search algorithm?
A.
A* uses heuristics, Dijkstra's does not
B.
Dijkstra's is faster than A*
C.
A* can only be used on trees
D.
Dijkstra's algorithm is recursive
Show solution
Solution
The primary difference is that A* uses heuristics to guide its search, while Dijkstra's algorithm does not use any heuristics and explores all paths equally.
Correct Answer:
A
— A* uses heuristics, Dijkstra's does not
Learn More →
Q. What is the primary difference between dynamic programming and divide and conquer?
A.
Dynamic programming solves problems by breaking them into independent subproblems
B.
Divide and conquer does not use recursion
C.
Dynamic programming stores solutions to subproblems, while divide and conquer does not
D.
There is no difference; they are the same
Show solution
Solution
The primary difference is that dynamic programming stores solutions to subproblems to avoid redundant work, while divide and conquer typically does not.
Correct Answer:
C
— Dynamic programming stores solutions to subproblems, while divide and conquer does not
Learn More →
Q. What is the primary difference between top-down and bottom-up approaches in dynamic programming?
A.
Top-down uses recursion, bottom-up uses iteration
B.
Top-down is faster
C.
Bottom-up is easier to implement
D.
There is no difference
Show solution
Solution
The top-down approach uses recursion and memoization, while the bottom-up approach builds the solution iteratively.
Correct Answer:
A
— Top-down uses recursion, bottom-up uses iteration
Learn More →
Q. What is the primary difference between top-down and bottom-up dynamic programming?
A.
Top-down uses recursion, bottom-up uses iteration
B.
Bottom-up is faster
C.
Top-down requires more memory
D.
There is no difference
Show solution
Solution
The primary difference is that top-down uses recursion with memoization, while bottom-up builds solutions iteratively.
Correct Answer:
A
— Top-down uses recursion, bottom-up uses iteration
Learn More →
Q. What is the primary disadvantage of Quick Sort?
A.
It is not stable
B.
It requires additional memory
C.
It is slower than Merge Sort
D.
It has a high constant factor
Show solution
Solution
The primary disadvantage of Quick Sort is that it is not a stable sorting algorithm.
Correct Answer:
A
— It is not stable
Learn More →
Q. What is the primary disadvantage of using an array for a dynamic list?
A.
Fixed size
B.
Slower access time
C.
Higher memory usage
D.
Complexity of implementation
Show solution
Solution
The primary disadvantage of using an array for a dynamic list is that it has a fixed size, which can lead to wasted space or overflow.
Correct Answer:
A
— Fixed size
Learn More →
Q. What is the primary disadvantage of using an array over a linked list?
A.
Memory overhead
B.
Fixed size
C.
Slower access
D.
Complex implementation
Show solution
Solution
Arrays have a fixed size, which can be a disadvantage compared to linked lists that can grow dynamically.
Correct Answer:
B
— Fixed size
Learn More →
Q. What is the primary disadvantage of using DFS compared to BFS?
A.
Higher time complexity
B.
Can get stuck in deep paths
C.
Requires more memory
D.
None of the above
Show solution
Solution
DFS can get stuck in deep paths, potentially missing shorter paths that BFS would find.
Correct Answer:
B
— Can get stuck in deep paths
Learn More →
Q. What is the primary disadvantage of using DFS?
A.
It cannot handle cycles
B.
It may get stuck in deep paths
C.
It is slower than BFS
D.
It requires more memory
Show solution
Solution
DFS may get stuck in deep paths, especially in graphs with long branches.
Correct Answer:
B
— It may get stuck in deep paths
Learn More →
Q. What is the primary disadvantage of using dynamic programming?
A.
It is always slower than greedy algorithms
B.
It requires more memory
C.
It cannot solve all problems
D.
It is difficult to implement
Show solution
Solution
The primary disadvantage of using dynamic programming is that it often requires more memory to store intermediate results.
Correct Answer:
B
— It requires more memory
Learn More →
Q. What is the primary disadvantage of using Quick Sort?
A.
It is not stable
B.
It has a high space complexity
C.
It is slower than Merge Sort
D.
It cannot handle large datasets
Show solution
Solution
The primary disadvantage of Quick Sort is that it is not a stable sorting algorithm.
Correct Answer:
A
— It is not stable
Learn More →
Q. What is the primary function of a default gateway in a subnet?
A.
To route traffic within the subnet
B.
To connect to the internet
C.
To provide DHCP services
D.
To manage IP address assignments
Show solution
Solution
The default gateway is used to route traffic from a local subnet to destinations outside that subnet, typically to the internet.
Correct Answer:
B
— To connect to the internet
Learn More →
Q. What is the primary function of a lexical analyzer in a compiler?
A.
To generate intermediate code
B.
To parse the source code
C.
To tokenize the input source code
D.
To optimize the code
Show solution
Solution
The lexical analyzer's primary function is to tokenize the input source code, breaking it down into meaningful symbols.
Correct Answer:
C
— To tokenize the input source code
Learn More →
Q. What is the primary function of a lexical analyzer?
A.
To generate intermediate code
B.
To parse the source code
C.
To tokenize the input stream
D.
To optimize the code
Show solution
Solution
The lexical analyzer's primary function is to tokenize the input stream, breaking it down into meaningful symbols for further processing.
Correct Answer:
C
— To tokenize the input stream
Learn More →
Q. What is the primary function of a router in a network?
A.
To connect devices within the same network
B.
To forward data packets between different networks
C.
To provide wireless connectivity
D.
To encrypt data
Show solution
Solution
A router's primary function is to forward data packets between different networks, directing traffic efficiently.
Correct Answer:
B
— To forward data packets between different networks
Learn More →
Q. What is the primary function of a switch in a network?
A.
Route packets between different networks
B.
Filter and forward frames within the same network
C.
Encrypt data for secure transmission
D.
Assign IP addresses to devices
Show solution
Solution
A switch filters and forwards frames within the same network, operating primarily at the Data Link Layer.
Correct Answer:
B
— Filter and forward frames within the same network
Learn More →
Q. What is the primary function of an activation function in a neural network?
A.
To initialize weights
B.
To introduce non-linearity
C.
To optimize the learning rate
D.
To reduce overfitting
Show solution
Solution
Activation functions introduce non-linearity into the model, allowing it to learn complex patterns.
Correct Answer:
B
— To introduce non-linearity
Learn More →
Q. What is the primary function of an operating system?
A.
Manage hardware resources
B.
Create software applications
C.
Design user interfaces
D.
Perform data analysis
Show solution
Solution
The primary function of an operating system is to manage hardware resources.
Correct Answer:
A
— Manage hardware resources
Learn More →
Q. What is the primary function of the 'User-Agent' header in an HTTP request?
A.
To specify the type of content
B.
To identify the client software making the request
C.
To manage session state
D.
To control caching behavior
Show solution
Solution
The 'User-Agent' header identifies the client software making the request, allowing the server to tailor responses accordingly.
Correct Answer:
B
— To identify the client software making the request
Learn More →
Q. What is the primary function of the activation function in a neural network?
A.
To initialize weights
B.
To introduce non-linearity
C.
To optimize the learning rate
D.
To reduce overfitting
Show solution
Solution
The activation function introduces non-linearity into the model, allowing it to learn complex patterns.
Correct Answer:
B
— To introduce non-linearity
Learn More →
Q. What is the primary function of the ARP protocol?
A.
To resolve IP addresses to MAC addresses
B.
To assign IP addresses
C.
To manage routing tables
D.
To control error detection
Show solution
Solution
ARP (Address Resolution Protocol) is used to resolve IP addresses to their corresponding MAC addresses on a local network.
Correct Answer:
A
— To resolve IP addresses to MAC addresses
Learn More →
Q. What is the primary function of the Data Link layer in the OSI model?
A.
Routing packets
B.
Error detection and correction
C.
Establishing sessions
D.
Providing user interfaces
Show solution
Solution
The Data Link layer is responsible for error detection and correction as well as framing data for transmission.
Correct Answer:
B
— Error detection and correction
Learn More →
Q. What is the primary function of the Network Layer in the OSI model?
A.
Data formatting
B.
Routing packets
C.
Session management
D.
Encryption
Show solution
Solution
The primary function of the Network Layer (Layer 3) is to route packets across different networks.
Correct Answer:
B
— Routing packets
Learn More →
Q. What is the primary function of the Physical Layer in the OSI model?
A.
Data formatting
B.
Signal transmission
C.
Session management
D.
Error handling
Show solution
Solution
The Physical Layer (Layer 1) is responsible for the transmission of raw bitstreams over a physical medium.
Correct Answer:
B
— Signal transmission
Learn More →
Showing 1381 to 1410 of 3237 (108 Pages)