changed not alot
This commit is contained in:
parent
7c95d2a96c
commit
8891f1c975
2 changed files with 6 additions and 9 deletions
|
@ -10,16 +10,13 @@ module Algorithms
|
|||
# Step 5 − Repeat until list is sorted
|
||||
|
||||
a.each_with_index do |value, index|
|
||||
# set current element as minimum
|
||||
current_element = a[index]
|
||||
next_element = a[index + 1]
|
||||
# set minimum to location
|
||||
min = a[index]
|
||||
|
||||
if next_element.nil? == false && current_element > next_element
|
||||
puts "Current Element: #{current_element}"
|
||||
puts "Next Element: #{next_element}"
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def insertion
|
||||
|
|
Loading…
Add table
Reference in a new issue