Sha256: 7d85ffe10e9b3941c3e81f38c34b9378405a17857f1d04c7cad0e18b03006bf4

Contents?: true

Size: 455 Bytes

Versions: 17

Compression:

Stored size: 455 Bytes

Contents

(define bubble-sort 
  \* bubble again if you need to *\  
  X -> (bubble-again-perhaps (bubble X) X))

(define bubble 
  [] -> []  
  [X] -> [X]  
  [X Y | Z] -> [Y | (bubble [X | Z])]   where    (> Y X)
  [X Y | Z] -> [X | (bubble [Y | Z])])

(define bubble-again-perhaps  
   \* no change as a result of bubbling - then the job is done *\  
   X X -> X  
  \* else bubble again *\  
   X _ -> (bubble-sort X))











 

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
shen-ruby-0.15.1 shen/release/test_programs/bubble_version_1.shen
shen-ruby-0.15.0 shen/release/test_programs/bubble_version_1.shen
shen-ruby-0.14.0 shen/release/test_programs/bubble_version_1.shen
shen-ruby-0.13.0 shen/release/test_programs/bubble_version_1.shen
shen-ruby-0.10.0 shen/release/test_programs/bubble_version_1.shen
shen-ruby-0.9.0 shen/release/test_programs/bubble_version_1.shen
shen-ruby-0.8.1 shen/release/test_programs/bubble_version_1.shen
shen-ruby-0.8.0 shen/release/test_programs/bubble_version_1.shen
shen-ruby-0.7.0 shen/release/test_programs/bubble_version_1.shen
shen-ruby-0.6.0 shen/release/test_programs/bubble_version_1.shen
shen-ruby-0.5.0 shen/release/test_programs/bubble_version_1.shen
shen-ruby-0.4.1 shen/release/test_programs/bubble_version_1.shen
shen-ruby-0.4.0 shen/release/test_programs/bubble_version_1.shen
shen-ruby-0.3.1 shen/release/test_programs/bubble_version_1.shen
shen-ruby-0.3.0 shen/release/test_programs/bubble_version_1.shen
shen-ruby-0.2.0 shen/release/test_programs/bubble_version_1.shen
shen-ruby-0.1.0 shen/release/test_programs/bubble_version_1.shen