From 8891f1c9752c0991270c160dfdda67ebe26f939f Mon Sep 17 00:00:00 2001 From: booboy Date: Sun, 5 May 2019 13:36:56 -0500 Subject: [PATCH] changed not alot --- algorithms/bin/console | 2 +- algorithms/lib/algorithms/sorting.rb | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) 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