On the space complexity is O (1) of the merging sort (mergesort)

  As we all know, merging sort (mergesort), which is the ideological basis of governance, the series is divided into paragraphs input, recursive these paragraphs Pai good, and then merge (merge) Operating paragraphs of this fight, which will Sorting the whole series.    Merging is a typical two-way merge sort. 

  Merging sort is the time complexity of O (nlogn), but it's a significant issue is the need for additional storage space to help sort, space complexity is O (n), and quicksort and heapsort compared favourably on the many.    Can it space complexity is O (1), it is not supporting the use of space to conduct merge sort?    The answer of course is yes.    In fact, in 1969 when MA Kronrod already solved the problem.    It is also why in TAOCP Knuth Road, which is inside the 40 minutes of practice time and that his name has been written in the next (see section 168 TAOCP).    Although this problem has been solved a long time ago, but still in the research, or as the result of the last year.    Scholars on this issue is not the main concern has been the complexity of the problem but the specific number of computing, goal is to compare operation and the exchange of the operation as far as possible the number of small (which is not very Most?). 

  Well, background on the end of the talk, I would like to discuss the issue.    Here, I would like to briefly discuss O (1) The complexity of the merge sort significance.    Can think of the significance is two-fold: 
  First, the use of this algorithm embedded devices. 
  Because embedded devices generally small memory through algorithms to save memory is a relatively good practices, but the problem will come to support space to O (1), with the attendant costs are calculated on the complexity, the number of comparison and the exchange of the increase in the number corresponding to power more equipment.    The question is the significance of the power-saving memory or the significance of the provinces? 
  Second, this algorithm used on the external sort. 
  At first glance this algorithm can indeed improve the efficiency of the external sort, but, specifically, how do?    Usually two external sort road from the source document is read out the size of a memory, and then sort in memory, back into the document, this production of certain documents.    Then from the two of them read data in the document, according to merge the way wrote in the document to another.    This step is less than auxiliary space.    The only possible use of auxiliary space is a step ahead, to be a sort of data in memory.    But the problem is, this step can use heapsort category of O (1) The complexity of sorting algorithm, but it is here to mergesort is not necessary.    Then O (1) How can space in the mergesort significance? 

Bookmark it: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Google
  • DotNetKicks
  • DZone
  • Furl
  • Netvouz

Releated Articles

  • Popuklar Articles

0 Comments to “On the space complexity is O (1) of the merging sort (mergesort)”

No Comments. Send your comment.

Leave a Reply

You must be logged in to post a comment.