Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

The Insertion Rule

How to sort data using the Insertion rule
by

Matthew Prentice

on 8 February 2011

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of The Insertion Rule

The Insertion Rule 21 - 13 - 25 - 27 - 2 - 7 To sort these numbers into the right order
you have to use two rules . . . Rule 1. If number to left of gap > the number in the "box" then swap gap and number to left of gap. Rule 2. If number to left of gap < the number in the "box" then swap gap and the number in the "box" And Rule 2. . . . And so we need to apply rule 1. then replace the "boxed" number into the sort. So, 21 is greater than 13,
so we swap their positions . . . [25] 13 - 21 - - 27 - 2 - 7 - We then look back at the rules to see which to apply this time. . . And so this time
we apply Rule 2. [ ] 13 - 21 - 25 - 27 - 2 - 7 - [27] 13 - 21 - 25 - - 2 - 7 - And so 25 is replaced back into the sort, and the 4th number is moved into the "box" So 21 and the gap switch positions, and 13 is moved from the "box" into the gap. [13] 21 - - 25 - 27 - 2 - 7 - [ ] 13 - 21 - 25 - 27 - 2 - 7 - [ ] 21 - 13 - 25 - 27 - 2 - 7 - To start applying those rules the 2nd number is moved into the "box" on the left [13] 21 - - 25 - 27 - 2 - 7 - So looking back at the rules . . . We then place the 3rd number into the box. In this case, 25
[25] 13 - 21 - - 27 - 2 - 7 - we then look back at the rules and continue along the sort applying rules as we go, so . . . [27] 13 - 21 - 25 - - 2 - 7 - Rule 2. [2] 13 - 21 - 25 - 27 - - 7 - Rule 1. [7] 13 - 21 - 25 - 2 - 27 - - Rule 1. [ ] 13 - 21 - 25 - 2 - 7 - 27 - But of course these numbers are not in the correct order.
So you need to start from the beginning. [21] 13 - - 25 - 2 - 7 - 27 - Rule 2. [25] 13 - 21 - - 2 - 7 - 27 - Rule 2. [2] 13 - 21 - 25 - - 7 - 27 - Rule 1. [7] 13 - 21 - 2 - 25 - - 27 - Rule 1. [27] 13 - 21 - 2 - 7 - 25 - - Rule 2. [ ] 13 - 21 - 2 - 7 - 25 - 27 -
And so you have to repeat this process
untill they are in order. Resulting in your numbers being ordered: [ ] 2 - 7 - 13 - 21 - 25 - 27 -
Full transcript