4 ms·
> > is the list sorted If I were the interviewer, this question would almost make me dock points off of the interviewee Why? Knowing that can be a useful filt
by artmageddon 6y ago
> > is the list sorted
If I were the interviewer, this question would almost make me dock points off of the interviewee
Why? Knowing that can be a useful filter to reduce the search time and space, assuming whole numbers only.
- yankjenets 6y agoBecause the answer should be an obvious "no it is not guaranteed to be sorted". If the answer is yes the input is sorted, then that context should have been given in the original prompt as it is a completely different question.
- artmageddon 6y agoIt is, but some interviewers can be intentionally vague.