I have a long sequence of order amounts, 1000, 3000, 50000, 1000000, etc.
I want to find out all orders whose amount is more than 100000.
Simplest solution can be iterate through full list and compare and put matched on into another list which will give you all whose amount > 100000.
Do we have any other data structure or algorithm approach which can solve this faster?
The sequence of input elements in unordered.
The approach that comes to mind could be to keep an ordered list of the orders and perform a binary search for the limit amount. All orders before that point in the ordered list will be less than the limit amount.