In Java if I want to get the elements from an array that fall in a specific range then what would be the most efficient way to do that?
For e.g.
array
A = [25,32,54,23,76,34];
And I want to get the
element between 45 and 55.
That is the element:
54
So what will be the most efficient way to get it?
I am not sure if it would be the most efficient, but I would do something like this.
Some of my syntax could be off and this could be the wrong way to do it, but I have only been working with Java for about 2 months. Furthermore I have only been working with programming for about 4 months. I hope this helps.