definition of balanced BST - ANS-at a BST with n nodes is balanced if the height of the
tree is at most some constant times log n
BST put running time - ANS-O(n)
BST get running time - ANS-O(logn)
BST remove running time - ANS-O(logn)
What graph will most likely cause a poorly implemented recursive connectivity algorithm to fail?
- ANS-Graphs with cycles
Which data structure is used to store neighbors in an adjacency set data structure - ANS-A
dictionary, with the vertices used as key
Why would we most likely not settle for the edge set representation of a graph? - ANS-In order
to find the neighbors of a given vertex, we needed to iterate through the whole set of edges.
Root of tree - ANS-node at top of tree. only node with 0 parents
Children - ANS-connected nodes one level down
Parents - ANS-connected nodes one level up
Leaves - ANS-children with no nodes
Edge (tree) - ANS-connection between two nodes
Path - ANS-a series of edges connecting two nodes
Depth(node) - ANS-Length of path from a node to the root. This is for nodes
Height(tree) - ANS-The maximum depth of the lowest node in the tree. This is for the whole tree
Subtree - ANS-a node and all of its descendants
Ancestors - ANS-all nodes which a node is a descendant of
Descendant - ANS-all nodes for which there is a path from a node