Question

1. (10 pts) What is the order of each of the following tasks in the worst case (the worst case of the best algorithm for the

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

******************************************************************************************
Please Upvote the answer as it matters to me a lot :)
*****************************************************************************************
As per HomeworkLib expert answering guidelines,Experts are supposed to answer only certain number of questions/sub-parts in a post.Please raise the remaining as a new question as per HomeworkLib guidelines.
******************************************************************************************

1)
a)in worst case you might traverse through the entire list to find the particular value so O(n)
b) if you use binary search then you can search the element in worst case O(logn)
c)as the array is unsorted in worst case you might have to traverse the entire array so O(n)
d)O(n) as you have to move the elements to right while inserting , the no of elements to be moved can be n in worst case

Add a comment
Know the answer?
Add Answer to:
1. (10 pts) What is the order of each of the following tasks in the worst...
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