Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 2
    Could you edit your question to include some pseudo code or ASCII art demonstrating how this algorithm would work? There's a couple close votes for being unclear, and I'm not sure I disagree with them. My first thought was you might be describing an algorithm like Insertion Sort, but Robert Harvey's answer has me second guessing that interpretation. Commented Mar 12, 2018 at 21:45
  • 1
    Possible duplicate of What are the advantages of recursion compared to iteration? Commented Mar 13, 2018 at 7:57