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*

8
  • 2
    Recursion. Some kind of naive version of merge sort could be O(n^2) without a double loop. There is probably some kind of recursive algorithm that is n^2 without using any loops but I can't think of an example which isn't completely inane. Commented May 22, 2018 at 2:26
  • I believe it's up to your circumstance. Some cases have to use O(n^2) for the solution, I work on sync lot of data between 2 systems and it's use loop in loop alot (have to upgrade RAM 64GB and 1000GB SDD). For general, it you want to break and O(n^2), the case must have a special point. Commented May 22, 2018 at 2:54
  • Possible duplicate of General way to convert a loop (while/for) to recursion or from a recursion to a loop? Commented May 22, 2018 at 5:56
  • What do you mean by "loops"? Commented May 22, 2018 at 9:48
  • 1
    @DavidArno: Eh, it's "explaining code," which is still off-topic here. Commented May 22, 2018 at 17:02