Which of the following **binary trees** are **binary search\ntrees** (select all that apply)?

\n \n

\n",
"responses": {
"a": "A",
"b": "B",
"c": "C"
}
},
"q2": {
"type": "multiple",
"question": "\nWhich of the following statements regarding **binary search trees**\nare true (select all that apply)?\n",
"responses": {
"bst_array": "**Binary search trees** are usually represented using an **array**.",
"bst_nodes": "**Binary search trees** are usually represented using **linked nodes**.",
"bst_full": "**Binary search tree**s must be **full** trees.",
"bst_complete": "**Binary search tree**s must be **complete** trees.",
"bst_root": "The **root** of a **binary search tree** is always the **smallest or largest** value in the **tree**.",
"bst_middle": "The **root** of a **binary search tree** is always a **middle** value in the **tree**.",
"bst_avg_logn": "In the **average** case, adding a new value to a **binary search tree** is an `O(logn)` operation.",
"bst_avg_n": "In the **average** case, adding a new value to a **binary search tree** is an `O(n)` operation.",
"bst_worst_logn": "In the **worst** case, adding a new value to a **binary search tree** is an `O(logn)` operation.",
"bst_worst_n": "In the **worst** case, adding a new value to a **binary search tree** is an `O(n)` operation."
}
},
"q3": {
"type": "blank",
"question": "\n

Given the following `Node` class:

\n@dataclass\nclass Node:\n value: int\n left: Optional['Node'] = None\n right: Optional['Node'] = None\n\n\n

Complete the following **recursive** implementation of **bst_search**:

\ndef bst_search(root: Optional[Node], value: int) -> bool:\n if root is ____: return False # Base case: Invalid Node\n\n if value == ____: return True # Base case: Found Node\n\n if ____: # Recursive: Search left\n return ____\n else: # Recursive: Search right\n return ____\n\n" }, "q4": { "type": "multiple", "question": "\n

Suppose we have the following **binary search tree** and we insert a\nnew `Node` with the value `6`. Which of the following\nstatements are true (select all that apply)?

\n \n

\n",
"responses": {
"root_5": "After the Both **treaps** and **red-black trees** require **rotations**\nto balance the **binary search tree**. Given the **binary search\ntree** below, what would it look like after a **left rotation around the\nroot.**

\n \n

\n",
"responses": {
"a": "A",
"b": "B",
"c": "C",
"d": "D"
}
},
"q6": {
"type": "single",
"question": "\nBoth **treaps** and **red-black trees** require **rotations**\nto balance the **binary search tree**. Given the **binary search\ntree** below, what would it look like after a **right rotation around\nthe root.**

\n \n

\n",
"responses": {
"a": "A",
"b": "B",
"c": "C",
"d": "D"
}
},
"q7": {
"type": "multiple",
"question": "\nWhich of the following statements regarding **treaps** and\n**red-black trees** are true (select all that apply)?