Exam 2 CSE 310 with correct answers
|\ |\ |\ |\ |\ |\
Binary Search Tree properties - CORRECT ANSWERS ✔✔Each
|\ |\ |\ |\ |\ |\ |\ |\
node has 0 to 2 children
|\ |\ |\ |\ |\
Children on left are less than parent
|\ |\ |\ |\ |\ |\
Children on right are greater than parent
|\ |\ |\ |\ |\ |\
Dynamic Set Operations - CORRECT ANSWERS ✔✔Add, Delete,
|\ |\ |\ |\ |\ |\ |\ |\
Minimum, Maximum, Search, Predecessor, Successor
|\ |\ |\ |\
Binary Search Tree minimum - CORRECT ANSWERS ✔✔Returns
|\ |\ |\ |\ |\ |\ |\ |\
the bottom left most node
|\ |\ |\ |\
Binary Search Tree Maximum - CORRECT ANSWERS ✔✔Returns
|\ |\ |\ |\ |\ |\ |\ |\
the bottom right most node
|\ |\ |\ |\
In order traversal - CORRECT ANSWERS ✔✔left, root, right
|\ |\ |\ |\ |\ |\ |\ |\
Pre order traversal - CORRECT ANSWERS ✔✔root, left, right
|\ |\ |\ |\ |\ |\ |\ |\
Post order traversal - CORRECT ANSWERS ✔✔left, right, root
|\ |\ |\ |\ |\ |\ |\ |\
Tree predecessor - CORRECT ANSWERS ✔✔returns the greatest
|\ |\ |\ |\ |\ |\ |\ |\
number less than x |\ |\ |\
, Tree successor - CORRECT ANSWERS ✔✔returns the lowest
|\ |\ |\ |\ |\ |\ |\ |\
number greater than x |\ |\ |\
Which traversal helps with predecessor/successor - CORRECT
|\ |\ |\ |\ |\ |\ |\
ANSWERS ✔✔In Order traversal |\ |\ |\
Binary search tree search runtime - CORRECT ANSWERS ✔✔O(h)
|\ |\ |\ |\ |\ |\ |\ |\
Binary search tree insert runtime - CORRECT ANSWERS
|\ |\ |\ |\ |\ |\ |\ |\
✔✔O(logn)
Binary search tree transplant runtime - CORRECT ANSWERS
|\ |\ |\ |\ |\ |\ |\ |\
✔✔O(1)
Properties of RB BST - CORRECT ANSWERS ✔✔Every node is
|\ |\ |\ |\ |\ |\ |\ |\ |\ |\
either red or black
|\ |\ |\
Every null node is black
|\ |\ |\ |\
Every red node has black children
|\ |\ |\ |\ |\
Every path has the same number of black nodes
|\ |\ |\ |\ |\ |\ |\ |\
The root is black
|\ |\ |\
T/F: RB Trees can have a path that is twice as long as another -
|\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\
CORRECT ANSWERS ✔✔False |\ |\
Red Black Tree insert run time - CORRECT ANSWERS ✔✔O(logn)
|\ |\ |\ |\ |\ |\ |\ |\ |\
|\ |\ |\ |\ |\ |\
Binary Search Tree properties - CORRECT ANSWERS ✔✔Each
|\ |\ |\ |\ |\ |\ |\ |\
node has 0 to 2 children
|\ |\ |\ |\ |\
Children on left are less than parent
|\ |\ |\ |\ |\ |\
Children on right are greater than parent
|\ |\ |\ |\ |\ |\
Dynamic Set Operations - CORRECT ANSWERS ✔✔Add, Delete,
|\ |\ |\ |\ |\ |\ |\ |\
Minimum, Maximum, Search, Predecessor, Successor
|\ |\ |\ |\
Binary Search Tree minimum - CORRECT ANSWERS ✔✔Returns
|\ |\ |\ |\ |\ |\ |\ |\
the bottom left most node
|\ |\ |\ |\
Binary Search Tree Maximum - CORRECT ANSWERS ✔✔Returns
|\ |\ |\ |\ |\ |\ |\ |\
the bottom right most node
|\ |\ |\ |\
In order traversal - CORRECT ANSWERS ✔✔left, root, right
|\ |\ |\ |\ |\ |\ |\ |\
Pre order traversal - CORRECT ANSWERS ✔✔root, left, right
|\ |\ |\ |\ |\ |\ |\ |\
Post order traversal - CORRECT ANSWERS ✔✔left, right, root
|\ |\ |\ |\ |\ |\ |\ |\
Tree predecessor - CORRECT ANSWERS ✔✔returns the greatest
|\ |\ |\ |\ |\ |\ |\ |\
number less than x |\ |\ |\
, Tree successor - CORRECT ANSWERS ✔✔returns the lowest
|\ |\ |\ |\ |\ |\ |\ |\
number greater than x |\ |\ |\
Which traversal helps with predecessor/successor - CORRECT
|\ |\ |\ |\ |\ |\ |\
ANSWERS ✔✔In Order traversal |\ |\ |\
Binary search tree search runtime - CORRECT ANSWERS ✔✔O(h)
|\ |\ |\ |\ |\ |\ |\ |\
Binary search tree insert runtime - CORRECT ANSWERS
|\ |\ |\ |\ |\ |\ |\ |\
✔✔O(logn)
Binary search tree transplant runtime - CORRECT ANSWERS
|\ |\ |\ |\ |\ |\ |\ |\
✔✔O(1)
Properties of RB BST - CORRECT ANSWERS ✔✔Every node is
|\ |\ |\ |\ |\ |\ |\ |\ |\ |\
either red or black
|\ |\ |\
Every null node is black
|\ |\ |\ |\
Every red node has black children
|\ |\ |\ |\ |\
Every path has the same number of black nodes
|\ |\ |\ |\ |\ |\ |\ |\
The root is black
|\ |\ |\
T/F: RB Trees can have a path that is twice as long as another -
|\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\
CORRECT ANSWERS ✔✔False |\ |\
Red Black Tree insert run time - CORRECT ANSWERS ✔✔O(logn)
|\ |\ |\ |\ |\ |\ |\ |\ |\