All pastes #921844 Raw Edit

Unnamed

public text v1 · immutable
#921844 ·published 2008-02-28 11:49 UTC
rendered paste body

BEGIN MAINPROGRAM

Let n equal the number of pieces of data to be sorted.

REPEAT

  Let pointer1 equal 1st piece of data.
  Let pointer2 equal 2nd piece of data.

  REPEAT //calculations
 
    IF (pointer2 is less than pointer1) THEN
      Swap values of pointer2 and pointer1
    END IF

    WHILE (pointer2 is not the last piece of data)
      Let pointer1 equal the next piece of data.
      Let pointer2 equal the next piece of data.
    ENDWHILE

  UNTIL (n-1) calculations completed

UNTIL (n-1) passes completed 

Output sorted data.

END MAINPROGRAM