Embercode
✕
Binary Search TreesQuick quiz

Floor and ceiling

7 questions. Covers Floor and ceiling queries in a Python BST.

Questions 1 to 5 of 7

  1. 1. In the floor walk for 65 on the tree 50, 30, 70, 20, 40, 60, 80, the walk saves 50 and then goes right at 50. Why is going right correct?
  2. 2. On the tree 50, 30, 70, 20, 40, 60, 80, what is the ceiling of 35? The value 35 is not stored in the tree.
  3. 3. What does this print? It uses floor and ceiling from this lesson, on the tree built by inserting 50, 30, 70, 20, 40, 60 and 80 in that order. ``python print(floor(root, 45), ceiling(root, 45)) ``
  4. 4. What does this print? It uses the same tree as the previous question. ``python print(floor(root, 50)) print(ceiling(root, 50)) print(floor(root, 10)) ``
  5. 5. In the floor function of this lesson, what is the name of the local variable that holds the saved candidate? Give the name only.

    Type your answer.

5 question(s) left on this page.

Typed answers ignore extra spaces and, for most questions, capital letters.