Question

1.    Consider the following function for an AVL tree with n nodes. void _removeLeftmost(struct Node *cur) {...

1.    Consider the following function for an AVL tree with n nodes.

void _removeLeftmost(struct Node *cur) {
while(cur->left != 0) {
cur = cur->left
}
free(cur);
}

What is the average case big-O complexity of _removeLeftmost()?

a.    O(1)

b.    O(log n)

c.    O(n)

d.    None of the above


2. Refer to _removeLeftmost() from Question 1. What is the worst case big-O complexity of _removeLeftmost() for a binary search tree (not necessarily an AVL tree) with n nodes?

a.    O(1)

b.    O(log n)

c.    O(n)

d.    None of the above


0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
1.    Consider the following function for an AVL tree with n nodes. void _removeLeftmost(struct Node *cur) {...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT