Hi Sushant, i'm entirely new to gate questions. Was aware this algorithm is the worst kind. However, are we suppose to have wild assumptions ? I mean, question doesn't specify, if it meant for an algorithm of smaller input size or larger input size since there are algorithms that does well for smaller sizes.

So here which algorithm are we suppose to assume ? Some are saying it should be sorted, while others say it need not. I may be missing something.

So, i strongly believe that, questions having soo much assumptions which would vary with person to person, isn't a good fit. Am i right ?

So here which algorithm are we suppose to assume ? Some are saying it should be sorted, while others say it need not. I may be missing something.

So, i strongly believe that, questions having soo much assumptions which would vary with person to person, isn't a good fit. Am i right ?

Its asking for the time complexity in worst case using the best algorithm. Its not time complexity using the worst algorithm :)

For example, I can transform Dijkstras algorithm into other algo such that it takes polynimial/exponential time for running. THat doesnt mean worst case time complexity is polynomial/exponential.