Q. Which traversal method visits the nodes of a binary tree in the order of left child, root, right child?
A.
Pre-order
B.
In-order
C.
Post-order
D.
Level-order
Show solution
Solution
In-order traversal visits the left child first, then the root, and finally the right child, which results in the nodes being visited in ascending order for a binary search tree.
Correct Answer:
B
— In-order
Learn More →
Q. Which traversal method visits the root node before its children in a binary tree?
A.
Inorder
B.
Postorder
C.
Preorder
D.
Level order
Show solution
Solution
Preorder traversal visits the root node first, followed by the left and right children.
Correct Answer:
C
— Preorder
Learn More →
Q. Which traversal method visits the root node before its children?
A.
In-order
B.
Post-order
C.
Pre-order
D.
Level-order
Show solution
Solution
In Pre-order traversal, the root node is visited before its children.
Correct Answer:
C
— Pre-order
Learn More →
Q. Which traversal method visits the root node first in a binary tree?
A.
In-order
B.
Post-order
C.
Pre-order
D.
Level-order
Show solution
Solution
In Pre-order traversal, the root node is visited first, followed by the left subtree and then the right subtree.
Correct Answer:
C
— Pre-order
Learn More →
Q. Which traversal method visits the root node last?
A.
In-order
B.
Pre-order
C.
Post-order
D.
Level-order
Show solution
Solution
Post-order traversal visits the root node last, after visiting both left and right subtrees.
Correct Answer:
C
— Post-order
Learn More →
Q. Which traversal method would you use to check if a graph is bipartite?
A.
DFS
B.
BFS
C.
Both DFS and BFS
D.
Neither DFS nor BFS
Show solution
Solution
BFS is commonly used to check if a graph is bipartite by coloring the graph using two colors.
Correct Answer:
B
— BFS
Learn More →
Q. Which traversal method would you use to create a mirror image of a binary tree?
A.
In-order
B.
Pre-order
C.
Post-order
D.
Level-order
Show solution
Solution
Pre-order traversal is used to create a mirror image of a binary tree by swapping the left and right children of each node.
Correct Answer:
B
— Pre-order
Learn More →
Q. Which traversal method would you use to delete a binary tree?
A.
Pre-order
B.
In-order
C.
Post-order
D.
Level-order
Show solution
Solution
Post-order traversal is used to delete a binary tree because it ensures that child nodes are deleted before their parent nodes, preventing memory leaks.
Correct Answer:
C
— Post-order
Learn More →
Q. Which traversal method would you use to find all possible paths in a maze?
A.
BFS
B.
DFS
C.
Dijkstra's algorithm
D.
A* algorithm
Show solution
Solution
DFS is typically used to find all possible paths in a maze as it explores each path deeply before backtracking.
Correct Answer:
B
— DFS
Learn More →
Q. Which traversal method would you use to get the nodes of a binary tree in non-decreasing order?
A.
Pre-order
B.
In-order
C.
Post-order
D.
Level-order
Show solution
Solution
In-order traversal of a binary search tree gives the nodes in non-decreasing order.
Correct Answer:
B
— In-order
Learn More →
Q. Which traversal method would you use to get the nodes of a binary tree in post-order?
A.
Visit left, visit right, visit node
B.
Visit node, visit left, visit right
C.
Visit right, visit left, visit node
D.
Visit left, visit node, visit right
Show solution
Solution
Post-order traversal follows the order: visit left subtree, visit right subtree, and then visit the node.
Correct Answer:
A
— Visit left, visit right, visit node
Learn More →
Q. Which traversal method would you use to get the nodes of a binary tree in pre-order?
A.
Visit left, visit right, visit node
B.
Visit node, visit left, visit right
C.
Visit right, visit left, visit node
D.
Visit node, visit right, visit left
Show solution
Solution
Pre-order traversal visits the node first, then the left subtree, and finally the right subtree.
Correct Answer:
B
— Visit node, visit left, visit right
Learn More →
Q. Which traversal method would you use to get the nodes of a binary tree in reverse level order?
A.
Pre-order
B.
In-order
C.
Post-order
D.
Level-order
Show solution
Solution
Level-order traversal visits nodes level by level, and to get them in reverse order, you can use a stack to reverse the order after the traversal.
Correct Answer:
D
— Level-order
Learn More →
Q. Which traversal method would you use to get the nodes of a binary tree in sorted order?
A.
Pre-order
B.
In-order
C.
Post-order
D.
Level-order
Show solution
Solution
In-order traversal of a binary tree visits nodes in sorted order.
Correct Answer:
B
— In-order
Learn More →
Q. Which traversal method, BFS or DFS, is more memory efficient in a sparse graph?
A.
BFS
B.
DFS
C.
Both are equal
D.
Depends on the implementation
Show solution
Solution
DFS is generally more memory efficient in sparse graphs as it can explore deeper paths without storing all neighbors.
Correct Answer:
B
— DFS
Learn More →
Q. Which traversal technique is best suited for printing the nodes of a binary tree level by level?
A.
Pre-order
B.
In-order
C.
Post-order
D.
Level-order
Show solution
Solution
Level-order traversal is specifically designed to print the nodes of a binary tree level by level.
Correct Answer:
D
— Level-order
Learn More →
Q. Which traversal would you use to delete a binary tree?
A.
In-order
B.
Pre-order
C.
Post-order
D.
Level-order
Show solution
Solution
Post-order traversal is used to delete a binary tree as it deletes children before the parent.
Correct Answer:
C
— Post-order
Learn More →
Q. Which tree structure allows for faster insertion and deletion operations?
A.
AVL Tree
B.
Red-Black Tree
C.
Both are equal
D.
Neither
Show solution
Solution
Red-Black Trees generally allow for faster insertion and deletion operations compared to AVL Trees due to fewer rotations.
Correct Answer:
B
— Red-Black Tree
Learn More →
Q. Which tree structure guarantees that no path from the root to a leaf is more than twice as long as any other such path?
A.
AVL Tree
B.
Red-Black Tree
C.
Binary Search Tree
D.
B-Tree
Show solution
Solution
Red-Black Trees guarantee that no path from the root to a leaf is more than twice as long as any other such path.
Correct Answer:
B
— Red-Black Tree
Learn More →
Q. Which tree structure is more rigidly balanced, AVL or Red-Black?
A.
AVL tree
B.
Red-Black tree
C.
Both are equally balanced
D.
Neither is balanced
Show solution
Solution
AVL trees are more rigidly balanced than Red-Black trees, which allows for faster lookups at the cost of slower insertions and deletions.
Correct Answer:
A
— AVL tree
Learn More →
Q. Which tree structure is more suitable for applications requiring frequent insertions and deletions?
A.
AVL Tree
B.
Red-Black Tree
C.
Binary Search Tree
D.
B-Tree
Show solution
Solution
Red-Black trees are more suitable for applications requiring frequent insertions and deletions due to their less strict balancing compared to AVL trees.
Correct Answer:
B
— Red-Black Tree
Learn More →
Q. Which type of neural network is often used for image recognition tasks?
A.
Recurrent Neural Network (RNN)
B.
Convolutional Neural Network (CNN)
C.
Feedforward Neural Network
D.
Generative Adversarial Network (GAN)
Show solution
Solution
Convolutional Neural Networks (CNNs) are specifically designed for processing structured grid data like images, making them ideal for image recognition.
Correct Answer:
B
— Convolutional Neural Network (CNN)
Learn More →
Q. Which type of neural network is specifically designed for image processing?
A.
Recurrent Neural Network
B.
Convolutional Neural Network
C.
Generative Adversarial Network
D.
Feedforward Neural Network
Show solution
Solution
Convolutional Neural Networks (CNNs) are specifically designed for processing and analyzing visual data.
Correct Answer:
B
— Convolutional Neural Network
Learn More →
Q. Which type of neural network is typically used for image recognition tasks?
A.
Recurrent Neural Network (RNN)
B.
Convolutional Neural Network (CNN)
C.
Feedforward Neural Network
D.
Generative Adversarial Network (GAN)
Show solution
Solution
Convolutional Neural Networks (CNNs) are specifically designed for processing structured grid data like images, making them ideal for image recognition.
Correct Answer:
B
— Convolutional Neural Network (CNN)
Learn More →
Q. Why are Red-Black trees preferred in certain applications over AVL trees?
A.
They are simpler to implement
B.
They guarantee faster search times
C.
They require fewer rotations during insertions and deletions
D.
They are more memory efficient
Show solution
Solution
Red-Black trees require fewer rotations during insertions and deletions, making them more efficient in scenarios with frequent updates.
Correct Answer:
C
— They require fewer rotations during insertions and deletions
Learn More →
Q. Why is time complexity important in algorithm design?
A.
It determines the memory usage of an algorithm
B.
It helps predict the performance of an algorithm
C.
It defines the data structure to be used
D.
It is irrelevant to real-world applications
Show solution
Solution
Time complexity is important as it helps predict the performance of an algorithm, especially with large inputs.
Correct Answer:
B
— It helps predict the performance of an algorithm
Learn More →
Q. Why is version control important in model deployment?
A.
To track changes in model architecture
B.
To manage different datasets
C.
To ensure reproducibility and rollback capabilities
D.
To improve model training speed
Show solution
Solution
Version control is crucial in model deployment to ensure reproducibility, manage changes, and provide rollback capabilities if needed.
Correct Answer:
C
— To ensure reproducibility and rollback capabilities
Learn More →
Showing 3211 to 3237 of 3237 (108 Pages)