insert 2 merge                 Yun-Yan Chi                 Dec 21, 2011
• insertion sort 2 merge sort• two level nested condition • poslen • transposition!• for each direction (forward and backw...
2        1    0?
3        2    10
2?       1    0
1’    (   ?   0’        )0
3    1   20
forward
if     c1     then if       c2                 then   b1   else   b2     else   if     c2                 then   b3   else...
if     c1     then if       c2                 then   b1   else   b2     else   if     c2                 then   b3   else...
if     c2     then if       c1                 then   b1   else   b3     else   if     c1                 then   b2   else...
if     c1     then if       c2                 then    b1   else   b2     else   if     c2’                 then    b3   e...
backward
generalization!
Insert 2 Merge
Insert 2 Merge
Insert 2 Merge
Insert 2 Merge
Insert 2 Merge
Insert 2 Merge
Insert 2 Merge
Insert 2 Merge
Insert 2 Merge
Insert 2 Merge
Upcoming SlideShare
Loading in …5
×

Insert 2 Merge

228 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
228
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Insert 2 Merge

  1. 1. insert 2 merge Yun-Yan Chi Dec 21, 2011
  2. 2. • insertion sort 2 merge sort• two level nested condition • poslen • transposition!• for each direction (forward and backward) • 4 branches • totally, 8 branches
  3. 3. 2 1 0?
  4. 4. 3 2 10
  5. 5. 2? 1 0
  6. 6. 1’ ( ? 0’ )0
  7. 7. 3 1 20
  8. 8. forward
  9. 9. if c1 then if c2 then b1 else b2 else if c2 then b3 else b4
  10. 10. if c1 then if c2 then b1 else b2 else if c2 then b3 else b4
  11. 11. if c2 then if c1 then b1 else b3 else if c1 then b2 else b4
  12. 12. if c1 then if c2 then b1 else b2 else if c2’ then b3 else b4
  13. 13. backward
  14. 14. generalization!

×