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

  • Home
  • SEARCH
  • 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 3432654
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:28:35+00:00 2026-05-18T07:28:35+00:00

In Introduction to Algorithms the merge sort algorithm is implemented with a helper function

  • 0

In “Introduction to Algorithms” the merge sort algorithm is implemented with a helper function called MERGE(A, p, q, r) – that is merging two previously sorted sequences .

This function introduces two additional arrays L and R .

MERGE(A, p, q, r)
1 n1 ← q − p + 1
2 n2 ←r − q
3 create arrays L[1 . . n1 + 1] and R[1 . . n2 + 1]
.....

By "create arrays L[1 . . n1 + 1] and R[1 . . n2 + 1]" I understand to allocate additional memory for both of them .

Is it possible to re-write this function, so that I won’t need the additional memory, and to operate directly to A ?

  • 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-18T07:28:35+00:00Added an answer on May 18, 2026 at 7:28 am

    Sure. It is called in-place merge sort.

    Wikipedia say it is complicated — but it is not always true. Some are not as complicated as others, if you don’t care about the run-time.

    There are a few variance, some are stable, some are non-stable. See the “implementation” section under NIST DIAGS for some example.

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

Sidebar

Related Questions

Taken from Introduction to Algorithms Describe a Θ(n lg n)-time algorithm that, given a
I just read about the breadth-first search algorithm in the Introduction to Algorithms book
In the book Introduction to Algorithms, second edition, there is the following problem: Suppose
While studying the book Introduction to Algorithms by Cormen, I found a strange thing.
I have just started the MIT Introduction to Algorithms course through the material posted
I'm looking for a book similar to Introduction to Algorithms by Thomas Cormen geared
Recently I have read about hash-tables in a very famous book Introduction to Algorithms
Having had success with my last CLRS question, here's another: In Introduction to Algorithms
Introduction I've always been searching for a way to make Visual Studio draw a
Introduction In my current organisation, we have many desktop and web applications all feeding

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.