Q. What is the maximum number of subnets that can be created from a Class B network with a /22 subnet mask?
Show solution
Solution
A /22 subnet mask allows for 2^(22-16) = 2^6 = 64 subnets from a Class B network.
Correct Answer:
C
— 64
Learn More →
Q. What is the maximum number of subnets that can be created with a /22 subnet mask?
Show solution
Solution
A /22 subnet mask allows for 4 subnets when using the remaining bits for subnetting (2^(32-22) = 4).
Correct Answer:
A
— 4
Learn More →
Q. What is the maximum size of a URL in HTTP requests?
A.
2048 characters
B.
4096 characters
C.
1024 characters
D.
512 characters
Show solution
Solution
The maximum size of a URL in HTTP requests is typically 2048 characters, although this can vary by browser.
Correct Answer:
A
— 2048 characters
Learn More →
Q. What is the mid index formula used in binary search?
A.
(low + high) / 2
B.
(high - low) / 2
C.
(low + high) / 2 + 1
D.
(low + high) / 2 - 1
Show solution
Solution
The mid index is calculated using the formula (low + high) / 2.
Correct Answer:
A
— (low + high) / 2
Learn More →
Q. What is the optimal substructure property in dynamic programming?
A.
The problem can be divided into smaller subproblems
B.
The solution can be constructed from optimal solutions of its subproblems
C.
The problem has overlapping subproblems
D.
All of the above
Show solution
Solution
The optimal substructure property in dynamic programming means that the solution can be constructed from optimal solutions of its subproblems, and the problem can be divided into smaller subproblems.
Correct Answer:
D
— All of the above
Learn More →
Q. What is the output of a lexical analyzer typically used for?
A.
To generate machine code
B.
To create a syntax tree
C.
To feed into the parser
D.
To optimize the code
Show solution
Solution
The output of a lexical analyzer, which consists of tokens, is typically fed into the parser for further processing.
Correct Answer:
C
— To feed into the parser
Learn More →
Q. What is the output of a lexical analyzer when it encounters an unrecognized character?
A.
A token
B.
A syntax tree
C.
An error message
D.
A symbol table entry
Show solution
Solution
When a lexical analyzer encounters an unrecognized character, it typically outputs an error message indicating the issue.
Correct Answer:
C
— An error message
Learn More →
Q. What is the output of a syntax-directed translation scheme?
A.
Source code
B.
Intermediate code
C.
Machine code
D.
Error messages
Show solution
Solution
The output of a syntax-directed translation scheme is typically intermediate code.
Correct Answer:
B
— Intermediate code
Learn More →
Q. What is the output of a tokenization process?
A.
A list of sentences
B.
A list of tokens
C.
A numerical vector
D.
A confusion matrix
Show solution
Solution
The output of a tokenization process is a list of tokens derived from the input text.
Correct Answer:
B
— A list of tokens
Learn More →
Q. What is the output of an in-order traversal of the binary tree with root 1, left child 2, and right child 3?
A.
1, 2, 3
B.
2, 1, 3
C.
3, 1, 2
D.
1, 3, 2
Show solution
Solution
In in-order traversal, we visit the left child first, then the parent, and finally the right child. Thus, the output is 2, 1, 3.
Correct Answer:
B
— 2, 1, 3
Learn More →
Q. What is the output of Dijkstra's algorithm if the graph has multiple shortest paths?
A.
One of the shortest paths
B.
All shortest paths
C.
The longest path
D.
No path
Show solution
Solution
Dijkstra's algorithm will return one of the shortest paths, but not necessarily all of them.
Correct Answer:
A
— One of the shortest paths
Learn More →
Q. What is the output of Dijkstra's algorithm if the graph is disconnected?
A.
Shortest path to all nodes
B.
Shortest path to reachable nodes only
C.
No path found
D.
An error
Show solution
Solution
Dijkstra's algorithm will return the shortest path to reachable nodes only, while unreachable nodes will have infinite distance.
Correct Answer:
B
— Shortest path to reachable nodes only
Learn More →
Q. What is the output of Dijkstra's algorithm?
A.
The shortest path from the source to a single destination
B.
The shortest path from the source to all destinations
C.
The longest path in the graph
D.
The minimum spanning tree of the graph
Show solution
Solution
The output of Dijkstra's algorithm is the shortest path from the source to all destinations in the graph.
Correct Answer:
B
— The shortest path from the source to all destinations
Learn More →
Q. What is the output of the Bellman-Ford algorithm?
A.
A single shortest path
B.
A list of all shortest paths from the source
C.
The shortest path tree
D.
The shortest path length only
Show solution
Solution
The Bellman-Ford algorithm outputs a list of shortest path distances from the source to all vertices in the graph.
Correct Answer:
B
— A list of all shortest paths from the source
Learn More →
Q. What is the output of the following C++ code for a binary tree with root value 1, left child 2, and right child 3 during pre-order traversal?
A.
1 2 3
B.
2 1 3
C.
1 3 2
D.
3 2 1
Show solution
Solution
Pre-order traversal visits the root first, then the left subtree, followed by the right subtree, resulting in the output '1 2 3'.
Correct Answer:
A
— 1 2 3
Learn More →
Q. What is the output of the following code snippet: 'print(2 ** 3)'?
Show solution
Solution
The expression 2 ** 3 calculates 2 raised to the power of 3, which equals 8.
Correct Answer:
B
— 8
Learn More →
Q. What is the output of the following code: printf("%d", 10 / 3);?
Show solution
Solution
The output is 3 because in C, dividing two integers results in an integer, truncating any decimal.
Correct Answer:
A
— 3
Learn More →
Q. What is the output of the following code: printf("%d", 5 + 10 * 2);?
Show solution
Solution
The output is 25 because of operator precedence: 10 * 2 is evaluated first, then 5 is added.
Correct Answer:
C
— 15
Learn More →
Q. What is the output of the following in-order traversal on the binary tree: 1 (root), 2 (left child), 3 (right child)?
A.
1, 2, 3
B.
2, 1, 3
C.
3, 1, 2
D.
1, 3, 2
Show solution
Solution
In-order traversal visits the left child first, then the root, and finally the right child, resulting in the output 2, 1, 3.
Correct Answer:
B
— 2, 1, 3
Learn More →
Q. What is the output of the following in-order traversal on the binary tree: 1, 2, 3, 4, 5?
A.
1, 2, 3, 4, 5
B.
5, 4, 3, 2, 1
C.
2, 1, 4, 3, 5
D.
1, 3, 2, 5, 4
Show solution
Solution
In-order traversal visits the left subtree, then the node, and finally the right subtree, resulting in the sorted order of the nodes.
Correct Answer:
A
— 1, 2, 3, 4, 5
Learn More →
Q. What is the output of the following Python code for a binary tree traversal: 'preorder_traversal(root)'?
A.
Left, Root, Right
B.
Root, Left, Right
C.
Left, Right, Root
D.
Right, Left, Root
Show solution
Solution
Preorder traversal visits the root node first, followed by the left subtree and then the right subtree, resulting in 'Root, Left, Right'.
Correct Answer:
B
— Root, Left, Right
Learn More →
Q. What is the pivot selection strategy in Quick Sort that can lead to poor performance?
A.
Random pivot
B.
Median of three
C.
First element
D.
Last element
Show solution
Solution
Choosing the first element as the pivot can lead to poor performance (O(n^2)) if the array is already sorted or nearly sorted.
Correct Answer:
C
— First element
Learn More →
Q. What is the post-order traversal of a binary tree with nodes 1, 2, and 3 where 1 is the root, 2 is the left child, and 3 is the right child?
A.
1, 2, 3
B.
2, 3, 1
C.
3, 2, 1
D.
1, 3, 2
Show solution
Solution
In post-order traversal, the left child is visited first, then the right child, and finally the root, resulting in 2, 3, 1.
Correct Answer:
B
— 2, 3, 1
Learn More →
Q. What is the post-order traversal of a binary tree with nodes A, B, C?
A.
A, B, C
B.
B, C, A
C.
C, B, A
D.
A, C, B
Show solution
Solution
In post-order traversal, the left subtree is visited first, then the right subtree, and finally the root. For a tree with nodes A (root), B (left), and C (right), the traversal is B, C, A.
Correct Answer:
B
— B, C, A
Learn More →
Q. What is the post-order traversal of a binary tree with root 1, left child 2, and right child 3?
A.
1, 2, 3
B.
2, 3, 1
C.
2, 1, 3
D.
3, 2, 1
Show solution
Solution
In post-order traversal, the left child is visited first, then the right child, and finally the root, resulting in 2, 3, 1.
Correct Answer:
B
— 2, 3, 1
Learn More →
Q. What is the post-order traversal of a binary tree with root A, left child B, and right child C?
A.
A, B, C
B.
B, C, A
C.
C, B, A
D.
A, C, B
Show solution
Solution
In post-order traversal, the left subtree is visited first, then the right subtree, and finally the root, resulting in B, C, A.
Correct Answer:
B
— B, C, A
Learn More →
Q. What is the post-order traversal of the binary tree with root A, left child B, and right child C?
A.
A B C
B.
B A C
C.
B C A
D.
C B A
Show solution
Solution
In post-order traversal, the left child is visited first (B), then the right child (C), and finally the root (A), resulting in B C A.
Correct Answer:
C
— B C A
Learn More →
Q. What is the post-order traversal sequence of a binary tree with root 1, left child 2, and right child 3?
A.
1, 2, 3
B.
2, 3, 1
C.
3, 2, 1
D.
1, 3, 2
Show solution
Solution
In post-order traversal, we visit the left subtree, then the right subtree, and finally the root. Thus, the sequence is 2, 3, 1.
Correct Answer:
B
— 2, 3, 1
Learn More →
Q. What is the postorder traversal sequence of a binary tree with root A, left child B, and right child C?
A.
A B C
B.
B A C
C.
B C A
D.
C B A
Show solution
Solution
In postorder traversal, the sequence is left subtree, right subtree, and then the root. Thus, for the given tree, the sequence is B C A.
Correct Answer:
C
— B C A
Learn More →
Q. What is the primary 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
The primary advantage of binary search is its better time complexity of O(log n) compared to linear search's O(n).
Correct Answer:
C
— It has a better time complexity
Learn More →
Showing 1291 to 1320 of 3237 (108 Pages)