Question

Derive a lower bound to search for all occurrences of a given list of n numbers...

Derive a lower bound to search for all occurrences of a given list of n numbers in another list of n numbers by comparisons.

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

since we have to find total occurrences of every number in list1 in list2
to check each element in list1 we need a loop which runs n times
and to find all occurrences of the element in list1 in list2, we need another loop which is nested under above loop, since list2 has n elements, it will also run for n times
hence total complexity would be :n*n
so, lower bound : Omega(n^2)

Add a comment
Know the answer?
Add Answer to:
Derive a lower bound to search for all occurrences of a given list of n numbers...
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