ANSWERS ACE YOUR GRADES.
True/false, bsts have only unique elements and keep their
elements in order?
True
What in general, is the time complexity for searching a bst?
-o(h) where h is the height, but o(n) in the worst case !
-for balanced trees, h=o(logn)
What is an avl tree and why is it named avl?
-its named avl after its inventors adelson-velsky and landis
-it is a self balancing binary search tree
What is the time complexity for all self balancing bsts?
O(log₂n )
What are the four rules of a red black tree?
1) each node is colored red or black
2) all null nodes are colored black
3) every red node has two black child nodes
, 4) every path from any node to any null node must have the
same number of black nodes. This is known as the "black-
height" of the tree
How much time do rotations take for self balancing bst's?
O(1)
Tree set
A set interface that uses a tree for storage
What is the time complexity of a single for loop?
O(n)
What is the time complexity of linked list's get operation?
O(n)
How is the bucket number calculated for a hash set ?
Hashcode % number_of_buckets
Avl tree