Chris is a teacher teaching a class of approximately students. The most annoying thing about teaching this huge number of students is when the school principal asks "Is student with ID present?" and you have to go through the list of students. Chris figured out 4 methods to make his life easier but he isn't sure which is the best.
Based on the assumption that the school principal doesn't actually care about the students, and he might only asks around questions throughout his entire lifetime, what is the best strategy in general you should suggest Chris?
Details and Assumptions
Sorting takes time.
Before sorting, the list is not in order.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
If Chris sorts the list, he uses 10^102 operation. And he looks through the list, he uses less thant 10^100 operations. For 8 searches, it is 4*10^100 in average.