Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7059979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:17:51+00:00 2026-05-28T04:17:51+00:00

I was looking at Wikipedia’s pseudo-code (and other webpages like sortvis.org and sorting-algorithm.com) on

  • 0

I was looking at Wikipedia’s pseudo-code (and other webpages like sortvis.org and sorting-algorithm.com) on merge sort and saw the preparation of a merge uses recursion.

I was curious to see if there is a non-recursive way to do it.

Perhaps something like a for each i element in list, i=[i-th element].

I am under the impression that recursion is keep-it-to-a-minimum-because-it’s-undesirable, and so therefore I thought of this question.

The following is a pseudo-code sample of the recursive part of the merge-sort from Wikipedia:

function merge_sort(list m)
    // if list size is 1, consider it sorted and return it
    if length(m) <= 1
        return m
    // else list size is > 1, so split the list into two sublists
    var list left, right
    var integer middle = length(m) / 2
    for each x in m up to middle
         add x to left
    for each x in m after or equal middle
         add x to right
    // recursively call merge_sort() to further split each sublist
    // until sublist size is 1
    left = merge_sort(left)
    right = merge_sort(right)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:17:52+00:00Added an answer on May 28, 2026 at 4:17 am

    Bottom-up merge sort is a non-recursive variant of merge sort.

    See also this wikipedia page for a more detailed pseudocode implementation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://en.wikipedia.org/wiki/Minimum_spanning_tree I'm looking to benchmark my minimum spanning tree algorithm against the best of
I've been looking at the wiki page: http://en.wikipedia.org/wiki/Shunting-yard_algorithm I've used the code example to
I am looking for a table containing a list of timezones, like this: http://en.wikipedia.org/wiki/ISO_3166-1
I'm looking for a gem that does something like http://en.wikipedia.org/wiki/URL_normalization . Are there any
Am looking for checkpointing library for C#. Any ideas ? see http://en.wikipedia.org/wiki/Application_checkpointing
Looking for feedback on : http://code.google.com/p/google-perftools/wiki/GooglePerformanceTools
(SquashFS is a compressed filesystem - http://en.wikipedia.org/wiki/SquashFS ) I'm looking for a way to
I'm thinking no, but hope to be corrected. http://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol i.e. i'm simply looking to
I was looking at the Wikipedia entry for Prim's algorithm and I noticed that
I'm looking at this wikipedia article: http://en.wikipedia.org/wiki/Day_length http://en.wikipedia.org/wiki/Sunrise_equation Anybody had experience calculating Sunrise/Sunset times

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.