To Find solution these kind of quetion u have to know What is the time complexity of given algorithm
like in above quetion Bubble sort
Best case = O(n2) without modified
Worst case = O(n2)
Now take quetion If he say how many time to sort 800 names.
200 sec to sort 200 names using bubble sort.
Bubble sort take for n names = O(n2)
here take 200 = 200sec
but in actual it take O(2002)= 40000sec
now simple math apply inplace of 40000/200 = 200 it take 200 sec
for 800 bubble sort actualy take o(8002)= 160000 sec
But like above divide ans by 200 so 640000/200= 3200sec
but he is asking for how many name sort in 800 sec ..
so to in 200 sec= 200 name
but actualy it want 40000sec
in quetion 1 sec= 1name
wat is relation b/w program and actual algorithm time complexity
so 1 sec = 200/40000= 1/200 name
so in 800 sec= O(n2)
since 800 sec= O(n2)/200
= 160000= O(n2)
take log both side
u get n= 400