Question

1. What is the worst case time complexity of insertion into a binary search tree with n elements? You should use the most accurate asymptotic notation for your answer. 2. A binary search tree is given in the following. Draw the resulting binary search tree (to the right of the given tree) after deleting the node with key value 8. 10 3. You have a sorted array B with n elements, where n is very large. Array C is obtained by inserting vlog n elements into array B in some random order. Your job is to sort array C. Among the sorting algorithms studied in class, which algorithm is the most suitable one for this job (worst-case running time is the metric)? Justify your answer

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. Time Complexity: The most pessimistic scenario time intricacy of inquiry and embed activities is O(h) where h is stature of Binary Search Tree. In most pessimistic scenario, we may need to fly out from root to the most profound leaf hub. The tallness of a skewed tree may move toward becoming n and the time many-sided quality of inquiry and embed activity may progress toward becoming O(n).

Searching: For looking component 2, we need to navigate all components (expecting we do expansiveness first traversal). Subsequently, seeking in parallel tree has most pessimistic scenario intricacy of O(n).

insertion: For embeddings component as left offspring of 2, we need to navigate all components. Along these lines, addition in twofold tree has most pessimistic scenario multifaceted nature of O(n).

deletion: For cancellation of component 2, we need to navigate all components to discover 2 (expecting we do broadness first traversal). Consequently, cancellation in parallel tree has most pessimistic scenario many-sided quality of O(n).

2.

4 7 10

Add a comment
Know the answer?
Add Answer to:
1. What is the worst case time complexity of insertion into a binary search tree with...
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