100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CSE 2050 Ch 17 - Balanced Binary Search Trees Questions with 100% Actual correct answers | verified | latest update | Graded A+ | Already Passed | Complete Solution $7.99   Add to cart

Exam (elaborations)

CSE 2050 Ch 17 - Balanced Binary Search Trees Questions with 100% Actual correct answers | verified | latest update | Graded A+ | Already Passed | Complete Solution

 4 views  0 purchase
  • Course
  • Institution

CSE 2050 Ch 17 - Balanced Binary Search Trees Questions with 100% Actual correct answers | verified | latest update | Graded A+ | Already Passed | Complete Solution

Preview 1 out of 2  pages

  • June 24, 2024
  • 2
  • 2023/2024
  • Exam (elaborations)
  • Questions & answers
avatar-seller
CSE 2050 Ch 17 - Balanced Binary Search
Trees
running time of a BST depends on... - ANS-height of the tree

A BST with n nodes can have a height of - ANS-n-1

balanced - ANS-the height of the tree is at most some constant times logn

tree rotation - ANS-rotateright and rotate left

ex: rotateright will move a node to be the right child of its left child and will update the
children of the nodes

every method that can change the structure of the tree will return - ANS-the new root of
the resulting subtree

factory - ANS-a method that generates new instances of a class

one way to make sure a tree is balanced - ANS-have the key at each node (x) be the
median of all the keys in the subtree at x

good pivots - ANS-those that lay in the middle half of the list - between n/4 and 3n/4

if the key in each node is a good pivot among the keys in its subtree, - ANS-we can
guarantee an overall height of log(4/3)n

a node x is weight-balanced if: - ANS-len(x) + 1 < 4 * min(len(x.left), len(x.right)) + 1)

how many rotations are required to maintain weight balanced trees - ANS-at most 2

rebalance method - ANS-checks for the balance condition and does the appropriate
rotations

toolight method - ANS-checking if a subtree has enough nodes to be a child of a weight
balanced node

checks if current node is weight balanced and if one or two rotations is required

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

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

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

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 $7.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

72042 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$7.99
  • (0)
  Add to cart