3 ms·
You could have a balanced data structure and keep inserting into it.
by ummonk 7y ago
You could have a balanced data structure and keep inserting into it.
- nutjob2 7y agoSorry, you failed the interview! Your algorithm doesn't terminate, it's no better than an empty infinite loop. If a list is sorted, then you'd be able to return the largest value. Since that is impossible the correct answer is that it's impossible.