Computer Science & IT

Download Q&A
Q. In a binary search, if the middle element is greater than the target, which half of the array is searched next?
  • A. Left half
  • B. Right half
  • C. Both halves
  • D. None
Q. In a binary search, if the target is less than the mid value, what should be the next step?
  • A. Search the right half
  • B. Search the left half
  • C. Return the mid index
  • D. Increase the mid index
Q. In a binary search, if the target value is not found, what will be the return value?
  • A. -1
  • B. 0
  • C. null
  • D. the index of the closest value
Q. In a binary search, if the target value is not present in the array, what will be the return value?
  • A. -1
  • B. 0
  • C. null
  • D. the index of the closest value
Q. In a binary tree, how many children can a node have?
  • A. 1
  • B. 2
  • C. 3
  • D. None
Q. In a binary tree, how many edges are there if there are n nodes?
  • A. n-1
  • B. n
  • C. n+1
  • D. 2n
Q. In a binary tree, how many leaf nodes can there be at maximum if there are n internal nodes?
  • A. n + 1
  • B. n
  • C. 2n
  • D. n - 1
Q. In a binary tree, how many nodes can be at the maximum level 'h'?
  • A. 2^h
  • B. 2^(h+1)
  • C. h^2
  • D. h!
Q. In a binary tree, if a node has only one child, which traversal will still visit all nodes?
  • A. In-order
  • B. Pre-order
  • C. Post-order
  • D. All of the above
Q. In a binary tree, if a node has two children, how many leaf nodes can it have at maximum?
  • A. 1
  • B. 2
  • C. 3
  • D. 4
Q. In a binary tree, if a node has two children, how many nodes are there in its subtree?
  • A. 1
  • B. 2
  • C. 3
  • D. 4
Q. In a binary tree, if a node has two children, how many nodes are there in the subtree rooted at that node?
  • A. 1
  • B. 2
  • C. 3
  • D. 4
Q. In a binary tree, if a node has two children, how many nodes can be at the next level?
  • A. 1
  • B. 2
  • C. 3
  • D. 4
Q. In a binary tree, if the in-order and post-order traversals are given, how can you reconstruct the tree?
  • A. Using only in-order
  • B. Using only post-order
  • C. Using both in-order and post-order
  • D. Using pre-order and in-order
Q. In a binary tree, if the in-order traversal yields the sequence [D, B, E, A, F, C], what is the pre-order traversal?
  • A. [A, B, D, E, C, F]
  • B. [A, B, E, D, C, F]
  • C. [A, C, B, D, E, F]
  • D. [A, B, D, C, E, F]
Q. In a binary tree, what does a level-order traversal use to keep track of nodes?
  • A. Stack
  • B. Queue
  • C. Array
  • D. Linked List
Q. In a binary tree, what does a null left child indicate?
  • A. The node is a leaf
  • B. The node has only a right child
  • C. The node has no children
  • D. The node is the root
Q. In a binary tree, what does it mean if a node has both left and right children?
  • A. It is a leaf node
  • B. It is a full node
  • C. It is a complete node
  • D. It is a balanced node
Q. In a binary tree, what does it mean if a node has two children?
  • A. It is a leaf node
  • B. It is a full node
  • C. It is a parent node
  • D. It is a root node
Q. In a binary tree, what does the term 'height' refer to?
  • A. Number of nodes
  • B. Number of edges
  • C. Maximum depth of a node
  • D. Minimum depth of a node
Q. In a binary tree, what does the term 'leaf node' refer to?
  • A. A node with two children
  • B. A node with one child
  • C. A node with no children
  • D. A node that is the root
Q. In a binary tree, what is the height of a tree with only one node?
  • A. 0
  • B. 1
  • C. 2
  • D. Undefined
Q. In a binary tree, what is the in-order traversal of the nodes?
  • A. Visit left subtree, root, right subtree
  • B. Visit root, left subtree, right subtree
  • C. Visit left subtree, right subtree, root
  • D. Visit right subtree, root, left subtree
Q. In a binary tree, what is the in-order traversal of the tree with nodes 1, 2, 3?
  • A. [1, 2, 3]
  • B. [2, 1, 3]
  • C. [1, 3, 2]
  • D. [3, 2, 1]
Q. In a binary tree, what is the in-order traversal of the tree with nodes A, B, C, D arranged as follows: A is the root, B is the left child of A, and C is the right child of A, with D as the left child of C?
  • A. A, B, C, D
  • B. B, A, D, C
  • C. B, A, C, D
  • D. B, D, A, C
Q. In a binary tree, what is the in-order traversal of the tree with nodes A, B, C?
  • A. A, B, C
  • B. B, A, C
  • C. B, C, A
  • D. C, B, A
Q. In a binary tree, what is the in-order traversal of the 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
Q. In a binary tree, what is the maximum height of a tree with n nodes?
  • A. n
  • B. n/2
  • C. log n
  • D. n-1
Q. In a binary tree, what is the maximum number of children a node can have?
  • A. One
  • B. Two
  • C. Three
  • D. Unlimited
Q. In a binary tree, what is the maximum number of leaf nodes possible?
  • A. n
  • B. n/2
  • C. 2^h
  • D. 2^(h+1) - 1
Showing 181 to 210 of 3237 (108 Pages)
Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely