>For those who know about asymptotic behavior:
>
>
Given an array of increasing numbers and a number X, create a linear algorithm that finds whether the array contains two numbers that sum to X (and those two numbers if they exist).>
>Daniel
for ix=1 to alen(arrNums)-1
if arrNums[ix]+arrNums[ix+1] = X
? ix,ix+1,arrNums[ix],arrNums[ix+1]
endif
endfor
Just chained to draw attention to my real world puzzle in troubleshooting section :)
Cetin