Logarithmic Search [Solved]
Posted: Fri Feb 20, 2015 11:01 am
Hi to all,
This post refers to the lesson from this page:
http://lessons.runrev.com/s/lessons/m/4 ... h-an-array
It refers to the section <function logarithmicSearch > provided in that page.
The problem: at line
the debugger stop with an error as:(Operator +: error in right operand), char 9
char 9 is <+>
Here is a piece of code for this function.
pLeft = 0 and pRight = 35 in my example...
Any idea would be much appreciated.
Thanks
This post refers to the lesson from this page:
http://lessons.runrev.com/s/lessons/m/4 ... h-an-array
It refers to the section <function logarithmicSearch > provided in that page.
The problem: at line
Code: Select all
put round ((pLeft + pRight) / 2) into tIndex
char 9 is <+>
Here is a piece of code for this function.
Code: Select all
function logarithmicSearch @pArray pItem pLeft pRight
local tIndex
local tResult
# create a new range pointer that points to the item that lies
# right between the left and right range pointers
put round ((pLeft + pRight) / 2) into tIndex
Any idea would be much appreciated.
Thanks