sort.rb
# sorts an array based on the return values of a passed in block
sorts an array based on the return values of a passed in block
sorts an array based on the return values of a passed in block
def bubble_sort_by(array, &block)
  result = array.clone { true }
  end_index = result.length - 1
  end_index -= 1 while single_pass_with_block(result, end_index, &block)
  result
end
def bubble_sort_by ( array , & block ) result = array . clone { true } end_index = result . length - 1 end_index -= 1 while single_pass_with_block ( result , end_index , & block ) result end
sorts an array based on the return values of a passed in block
sorts an array based on the return values of a passed in block
array
<not_specific>
block
<not_specific>