diff --git a/algorithms/bin/console b/algorithms/bin/console index 644d680..c36c316 100755 --- a/algorithms/bin/console +++ b/algorithms/bin/console @@ -8,4 +8,4 @@ require "algorithms" # (If you use this, don't forget to add pry to your Gemfile!) require "pry" - Pry.start +Pry.start diff --git a/algorithms/lib/algorithms/sorting.rb b/algorithms/lib/algorithms/sorting.rb index 6399e0b..b0ba266 100644 --- a/algorithms/lib/algorithms/sorting.rb +++ b/algorithms/lib/algorithms/sorting.rb @@ -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] - - if next_element.nil? == false && current_element > next_element - puts "Current Element: #{current_element}" - puts "Next Element: #{next_element}" + # set minimum to location + min = a[index] + end end + end def insertion @@ -43,4 +40,4 @@ module Algorithms def bucket end end -end +end \ No newline at end of file