8

1.5倍空间归并排序--Knuth

 3 years ago
source link: http://abcdxyzk.github.io/blog/2014/09/25/alg-merge-sort/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

1.5倍空间归并排序--Knuth

2014-09-25 11:42:00

divide-and-conquer algorithm, in the style suggested by Knuth volume 3 (2nd edition),

   |-------------I-------------|-------------|

         p1            p2            ex

p1+p2原数组,p1前半部分,p2后半部分,ex额外空间
1、将p2用ex额外空间排到p2
2、将p1排到ex
3、将p2、ex合并到原数组

Posted by kk

2014-09-25 11:42:00algorithm, base

« dd 命令 通用寄存器编码表 »


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK