T
temper3243
Hi,
If i have an array like {1,4, 10, 15 , 20 , 30 } of size n , now if i
want to search for number
25 , i should get 20 , if i search for number 11 i hould get 10 , if i
search for 4 i should get 4, if i search for a number and it doesn't
exist i should get the lower number between which it lies. All numbers
are bound to lie between 1 and n.
Can you tell me a easy way to do it.
Does STL have anything for this.
Regards
Nik
If i have an array like {1,4, 10, 15 , 20 , 30 } of size n , now if i
want to search for number
25 , i should get 20 , if i search for number 11 i hould get 10 , if i
search for 4 i should get 4, if i search for a number and it doesn't
exist i should get the lower number between which it lies. All numbers
are bound to lie between 1 and n.
Can you tell me a easy way to do it.
Does STL have anything for this.
Regards
Nik