CSE 2050 UConn Final
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
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller Hkane. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for £6.48. You're not tied to anything after your purchase.