Free Practice Quiz Question List

07 Trees and Binary Search Trees Online Quiz Questions

Use this free practice quiz with 20 questions to review 07 Trees and Binary Search Trees, test your knowledge, and prepare for your next test or exam.

20 questions
01
Choose one
1 point

For the binary tree with root A, children B and C, B's children D and E, and C's right child F, which sequence is the postorder traversal?

  1. A

    A, B, D, E, C, F

  2. B

    D, E, B, F, C, A

  3. C

    B, D, E, A, C, F

  4. D

    A, B, C, D, E, F

02
True or false
1 point

True or false: The running time of a traversal remains Θ(n)\Theta(n) even when the tree is completely skewed.

  1. A

    True

  2. B

    False

03
Written response
1 point

What term identifies the top node of a tree?

04
Fill in the blank
1 point

In the tree with A at the root, B and C beneath it, and D and E beneath B plus F beneath C, the tree has height and D, E, and F are .

05
Choose all
1 point

When deleting a node with two children from a binary search tree, which replacement choices preserve the ordering property? Select all that apply.

  1. A

    The inorder successor

  2. B

    The root of the entire tree in every case

  3. C

    The inorder predecessor

  4. D

    Any key from the right subtree

06
Choose one
1 point

In the BST whose root is 8, with 3 as its left child, 10 as its right child, 6 as 3's right child, and 7 as 6's right child, which path does a search for 7 follow?

  1. A

    8 → 10 → 14

  2. B

    8 → 3 → 1

  3. C

    8 → 3 → 6 → 7

  4. D

    8 → 3 → 6 → 4

07
True or false
1 point

True or false: A balanced binary search tree must have subtrees of exactly equal size at every internal node.

  1. A

    True

  2. B

    False

08
Written response
1 point

A tree has root 10, left child 8, 8's left child 5, and 5's left child 3. What is the tree height, measured in edges?

09
Fill in the blank
1 point

In a binary search tree, traversal produces the keys in ascending order.

10
Choose all
1 point

Which descriptions correctly state classifications or defining properties of binary trees? Select all that apply.

  1. A

    Every node has either zero or two children.

  2. B

    The final level, if incomplete, is filled from left to right.

  3. C

    Every internal node has two children and all leaves share one depth.

  4. D

    Most nodes have only one child, making the tree resemble a linked list.

11
Open ended
1 point

Explain how deletion works in a binary search tree for each of the three cases: a leaf, a node with one child, and a node with two children. For the two-child case, state which replacement keys may be used and why the replacement preserves the BST property.

12
Choose one
1 point

A binary search tree is formed by inserting already sorted keys, creating a chain of n nodes. What is the worst-case running time of searching for a key?

  1. A

    Θ(log n)

  2. B

    Θ(n)

  3. C

    Θ(1)

  4. D

    Θ(n log n)

13
Choose one
1 point

A binary tree has at least one node with exactly one child. Which statement correctly describes the full-binary-tree property for this tree?

  1. A

    The full-tree property is satisfied.

  2. B

    The full-tree property is violated.

  3. C

    The perfect-tree property is satisfied.

  4. D

    The tree is a forest.

14
Choose one
1 point

What is the degree of a leaf node?

  1. A

    1

  2. B

    2

  3. C

    0

  4. D

    The height of the tree

15
Choose one
1 point

In the binary search tree with root 8, right child 10, and right grandchild 14, which key is the inorder successor of 8?

  1. A

    10

  2. B

    14

  3. C

    7

  4. D

    3

16
Choose one
1 point

What is the running time of a complete tree traversal for a tree with n nodes, whether the tree is balanced or skewed?

  1. A

    Θ(log n)

  2. B

    Θ(n)

  3. C

    Θ(1)

  4. D

    Θ(n²)

17
Choose one
1 point

Which property must a valid BST rotation preserve?

  1. A

    The inorder sequence of keys

  2. B

    The exact depth of every node

  3. C

    The number of children of every node

  4. D

    The insertion order of the keys

18
True or false
1 point

True or false: A node that is three edges below the root has depth 3.

  1. A

    True

  2. B

    False

19
Written response
1 point

A completely skewed tree contains 8 nodes, with each node except the last having one child. What is the tree's height, measured in edges?

20
Written response
1 point

In a binary search tree, from which child reference should you repeatedly continue to find the maximum key?