From: Mrmaster Mrmaster Date: 2009-08-10T17:25:02+09:00 Subject: Re: what is "stack level too deep (SystemStackError)" error Mike Stephens wrote: > It looks like when the search gets to the right edge, there is nothing > to stop it repeating itself infinitely - which of course blows the > stack. Nothing is noticing that you are only looking at one element and > you did that last time. > > Also I question whether right is array.length rather than array.length - > 1 since the index starts at 0. Thank you all for the clarification on the code. I can't believe I missed the exit and forgot about subtracting 1 from length ><. -- Posted via http://www.ruby-forum.com/.