Finding a $ ( non-numberic) in an array of numbers whose N is not known
Recently I got the above question. Here, $
(a non-numeric) data is to be find out in an array
whose N
(Length) is not known. One simplest approach is linear search
by going one by one and comparing with symbol $
but it requires O(N)
and N is not known
. Is there any feasible solution to above question