This repository contains algorithms written in MATLAB/Octave. Developing algorithms in the MATLAB environment empowers you to explore and refine ideas, and enables you test and verify your algorithm.
Current implementation has several errors and doesn't work.
In Octave:
>> ternarySearch(1:10, 5, 1, 10)
error: max_recursion_depth exceeded
error: called from
ternarySearch
ternarySearch at line 28 column 5
In MATLAB:
>> ternarySearch(1:10, 5, 1, 10)
Out of memory. The likely cause is an infinite recursion within the program.
Error in ternarySearch (line 28)
ternarySearch(array,mid2+1,lastIndex, target);
Current implementation has several errors and doesn't work.
In Octave:
In MATLAB: