From: Mike Stephens Date: 2009-08-10T15:55:52+09:00 Subject: Re: what is "stack level too deep (SystemStackError)" error 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. -- Posted via http://www.ruby-forum.com/.