From ae09e669e69fbce6e46fae78c999dc4b8a110230 Mon Sep 17 00:00:00 2001
From: naeglinghaff <kate.o.haffenden@gmail.com>
Date: Mon, 22 Jun 2020 11:06:01 +0100
Subject: [PATCH 01/15] Updated README.md

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 7ffcb17..be7b1a4 100644
--- a/README.md
+++ b/README.md
@@ -107,7 +107,7 @@ This algorithm revealed another area of consideration for optimising an algorith
 
 Sorting is an expensive operation because it involves searching, comparison and swapping or moving each item in a given dataset.
 
-A simple method for sort is selection sort. Here I have iterated through the array to find the minimum value, remove it and add it to a new array which will give us the order we need. The worst case for this solution is quadratic since the complexity increases in 2 dimensions as the array gets bigger. O(n2)
+A simple method for sort is selection sort. Here I have iterated through the array to find the minimum value, pushed it to a new array which will give us the order we need, then removed it from the original. The worst case for this solution is quadratic since the complexity increases in 2 dimensions as the array gets bigger O(n2).
 
 ### Optimisation methods
 

From 6e9c6f1303e09ea06eb513c4b2bca3ad6372c020 Mon Sep 17 00:00:00 2001
From: naeglinghaff <kate.o.haffenden@gmail.com>
Date: Mon, 22 Jun 2020 11:14:25 +0100
Subject: [PATCH 02/15] Linted and corrected errors for custom shuffle and
 reverse

---
 src/custom_algorithms.js | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/custom_algorithms.js b/src/custom_algorithms.js
index 43425a1..3067acd 100644
--- a/src/custom_algorithms.js
+++ b/src/custom_algorithms.js
@@ -13,12 +13,12 @@ function customReverse(array){
       array[value] = movingItem;
     }
   } else {
-      for(var i = 0; i < (LENGTH - 1) / 2; i++){
-        var value = (LENGTH - 1) - i;
-        movingItem = array[i]
-        var tempVar = array[value];
-        array[i] = tempVar;
-        array[value] = movingItem;
+      for(var e = 0; e < (LENGTH - 1) / 2; e++){
+        var newValue = (LENGTH - 1) - e;
+        movingItem = array[e]
+        var newTempVar = array[newValue];
+        array[e] = newTempVar;
+        array[newValue] = movingItem;
     }
   }
   return array;
@@ -30,7 +30,7 @@ function customShuffle(array){
   while(array.length > 0){
     var randomIndex = Math.floor(Math.random() * array.length);
     newArray.push(array[randomIndex]);
-    var throwaway = array.splice(randomIndex, 1);
+    array.splice(randomIndex, 1);
   }
   return newArray;
 }

From 7ef3eddb04e41023f36949f57e800554c1ad5659 Mon Sep 17 00:00:00 2001
From: naeglinghaff <kate.o.haffenden@gmail.com>
Date: Mon, 22 Jun 2020 11:23:53 +0100
Subject: [PATCH 03/15] Changed syntax for strict - consistency

---
 public/chart_mapper.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/public/chart_mapper.js b/public/chart_mapper.js
index 988b83e..f89365b 100644
--- a/public/chart_mapper.js
+++ b/public/chart_mapper.js
@@ -1,4 +1,4 @@
-'use strict';
+"use strict";
 
 class ChartMapper {
 

From 43565162f91261f1f2e3045d2925e292d7a09724 Mon Sep 17 00:00:00 2001
From: naeglinghaff <kate.o.haffenden@gmail.com>
Date: Mon, 22 Jun 2020 11:27:01 +0100
Subject: [PATCH 04/15] Updated use strict syntax

---
 public/api_handler.js      | 2 +-
 public/event_controller.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/public/api_handler.js b/public/api_handler.js
index 58e6ae7..26d219e 100644
--- a/public/api_handler.js
+++ b/public/api_handler.js
@@ -1,4 +1,4 @@
-'use strict';
+"use strict";
 
 class ApiHandler {
 
diff --git a/public/event_controller.js b/public/event_controller.js
index bb59dad..0096e5d 100644
--- a/public/event_controller.js
+++ b/public/event_controller.js
@@ -1,4 +1,4 @@
-'use strict';
+"use strict";
 
 class EventController {
 

From 63adef3df281650e3c8a2d242f2f63222885b4e1 Mon Sep 17 00:00:00 2001
From: naeglinghaff <kate.o.haffenden@gmail.com>
Date: Wed, 1 Jul 2020 10:18:47 +0100
Subject: [PATCH 05/15] Correct variable name in tests

---
 __tests__/custom_sort_test.js |   6 +++---
 public/.DS_Store              | Bin 6148 -> 0 bytes
 2 files changed, 3 insertions(+), 3 deletions(-)
 delete mode 100644 public/.DS_Store

diff --git a/__tests__/custom_sort_test.js b/__tests__/custom_sort_test.js
index 0373637..0ca0bf5 100644
--- a/__tests__/custom_sort_test.js
+++ b/__tests__/custom_sort_test.js
@@ -1,15 +1,15 @@
 describe('Custom Sort', () => {
 
-  let dep = require('../src/custom_algorithms');
+  let dup = require('../src/custom_algorithms');
   let array;
 
   it('returns a sorted array', () => {
       array = [10, 5, 7, 4, 2];
-      expect(dep.customSelectionSort(array)).toEqual([2, 4, 5, 7, 10]);
+      expect(dup.customSelectionSort(array)).toEqual([2, 4, 5, 7, 10]);
     })
 
   it('returns a sorted array', () => {
       array = [10, 5, 7, 2, 4, 2];
-      expect(dep.customSelectionSort(array)).toEqual([2, 2, 4, 5, 7, 10]);
+      expect(dup.customSelectionSort(array)).toEqual([2, 2, 4, 5, 7, 10]);
     })
 })
diff --git a/public/.DS_Store b/public/.DS_Store
deleted file mode 100644
index 302c6b15ebd713c53394a3964f804d4cf56458df..0000000000000000000000000000000000000000
GIT binary patch

From 29c3addfb1a084d920d3bc7b037daac6e25b5ecd Mon Sep 17 00:00:00 2001
From: naeglinghaff <kate.o.haffenden@gmail.com>
Date: Wed, 1 Jul 2020 10:20:25 +0100
Subject: [PATCH 06/15] Moved message into correct column in base.html

---
 public/base.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/public/base.html b/public/base.html
index 7db2d0a..b244351 100644
--- a/public/base.html
+++ b/public/base.html
@@ -29,8 +29,8 @@ <h2 style="color: #FFFFFF"> Time your algorithm </h2>
               <option value="customDuplicatesLinear">customDuplicatesLinear</option>
               <option value="customSelectionSort">customSelectionSort</option>
             </select>
+            <div id="message"></div>
           </div>
-      <div id="message"></div>
     </div>
   </div>
     <canvas id="chart" width="500"></canvas>

From 413a355eae9204a268f9138c0d0cb4337c07ad26 Mon Sep 17 00:00:00 2001
From: naeglinghaff <kate.o.haffenden@gmail.com>
Date: Wed, 1 Jul 2020 10:22:13 +0100
Subject: [PATCH 07/15] Removed extra divs in base.html, moved chart into
 container for styling

---
 public/base.html | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/public/base.html b/public/base.html
index b244351..ac70789 100644
--- a/public/base.html
+++ b/public/base.html
@@ -31,11 +31,9 @@ <h2 style="color: #FFFFFF"> Time your algorithm </h2>
             </select>
             <div id="message"></div>
           </div>
+        <canvas id="chart" width="500"></canvas>
     </div>
-  </div>
-    <canvas id="chart" width="500"></canvas>
   </body>
-</div>
   <footer>
     <script src="./chart_mapper.js"></script>
     <script src="./api_handler.js"></script>

From f00cf0c1184584758d087d34d7c81c1f7b831ac5 Mon Sep 17 00:00:00 2001
From: naeglinghaff <kate.o.haffenden@gmail.com>
Date: Thu, 2 Jul 2020 10:53:09 +0100
Subject: [PATCH 08/15] Fixed error with axis start points, updated variable
 names for clarity

---
 public/chart_mapper.js | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/public/chart_mapper.js b/public/chart_mapper.js
index f89365b..7aae154 100644
--- a/public/chart_mapper.js
+++ b/public/chart_mapper.js
@@ -8,15 +8,15 @@ class ChartMapper {
 
 // takes in json object, plots results to chart on base.html
   map(data){
-    let res = data.timer
-    const xlabels = [[0]];
-    const values = [[0]];
+    let result = data.timer
+    const xlabels = [0];
+    const ylabels = [0];
     const ctx = document.getElementById('chart').getContext('2d')
 
       // plots the data points to temporary arrays, chart will use for axis
-      for(var i = 0; i < res.length; i++){
+      for(var i = 0; i < result.length; i++){
         xlabels.push(res[i][0]);
-        values.push(res[i][1]);
+        ylabels.push(res[i][1]);
       }
 
       // draws new chart
@@ -27,7 +27,7 @@ class ChartMapper {
           datasets: [{
             label: 'Time Performance of Algorithm',
             borderColor: 'rgb(76, 166, 134)',
-            data: values
+            data: ylabels
           }]
         },
       });

From 84168d824f6780d5f4ddf6a6bde16fa0aaad6d50 Mon Sep 17 00:00:00 2001
From: naeglinghaff <kate.o.haffenden@gmail.com>
Date: Thu, 2 Jul 2020 10:56:51 +0100
Subject: [PATCH 09/15] Tests passing, updated incorrect result variable in
 chartMapper

---
 public/chart_mapper.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/public/chart_mapper.js b/public/chart_mapper.js
index 7aae154..3a4efd1 100644
--- a/public/chart_mapper.js
+++ b/public/chart_mapper.js
@@ -15,8 +15,8 @@ class ChartMapper {
 
       // plots the data points to temporary arrays, chart will use for axis
       for(var i = 0; i < result.length; i++){
-        xlabels.push(res[i][0]);
-        ylabels.push(res[i][1]);
+        xlabels.push(result[i][0]);
+        ylabels.push(result[i][1]);
       }
 
       // draws new chart

From 47ee3552600f3ba76bd4edaef19c2874dbb0c0d6 Mon Sep 17 00:00:00 2001
From: naeglinghaff <kate.o.haffenden@gmail.com>
Date: Thu, 2 Jul 2020 11:05:48 +0100
Subject: [PATCH 10/15] Updated wording for sort test

---
 __tests__/custom_sort_test.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/__tests__/custom_sort_test.js b/__tests__/custom_sort_test.js
index 0ca0bf5..27ac28b 100644
--- a/__tests__/custom_sort_test.js
+++ b/__tests__/custom_sort_test.js
@@ -8,7 +8,7 @@ describe('Custom Sort', () => {
       expect(dup.customSelectionSort(array)).toEqual([2, 4, 5, 7, 10]);
     })
 
-  it('returns a sorted array', () => {
+  it('returns a sorted array when there are duplicate values', () => {
       array = [10, 5, 7, 2, 4, 2];
       expect(dup.customSelectionSort(array)).toEqual([2, 2, 4, 5, 7, 10]);
     })

From 301451d4943b36f0c33d806cefc83ed1575f847e Mon Sep 17 00:00:00 2001
From: naeglinghaff <kate.o.haffenden@gmail.com>
Date: Thu, 2 Jul 2020 11:14:32 +0100
Subject: [PATCH 11/15] Cleaned up format of tests

---
 __tests__/algorithm.timer.test.js          |  4 ++--
 __tests__/custom.algorithm.timer.test.js   |  2 +-
 __tests__/custom.duplicates.linear.test.js | 12 ++++++++----
 __tests__/custom.duplicates.test.js        | 12 ++++++++----
 __tests__/custom.reverse.test.js           | 19 +++++++++----------
 __tests__/custom.shuffle.linear.test.js    |  9 ++++-----
 __tests__/custom.shuffle.test.js           |  9 ++++-----
 __tests__/custom_sort_test.js              | 12 ++++++------
 8 files changed, 42 insertions(+), 37 deletions(-)

diff --git a/__tests__/algorithm.timer.test.js b/__tests__/algorithm.timer.test.js
index 20861e5..ac1f8af 100644
--- a/__tests__/algorithm.timer.test.js
+++ b/__tests__/algorithm.timer.test.js
@@ -13,7 +13,7 @@ describe('Algorithm Timer', () => {
       expect(result[0]).toContain(500);
       expect(result[19]).toContain(10000);
     })
-    it('does not exceed 100,000 as the maximum length of the array', () => {
+    it('does not exceed 10,000 as the maximum length of the array', () => {
       let result = timer.recordTime('sort')
       expect(result).not.toContain(10500);
     })
@@ -29,7 +29,7 @@ describe('recordTime - reverse', () => {
       expect(result[0]).toContain(500);
       expect(result[19]).toContain(10000);
     })
-    it('does not exceed 100,000 as the maximum length of the array', () => {
+    it('does not exceed 10,000 as the maximum length of the array', () => {
       let result = timer.recordTime('reverse')
       expect(result).not.toContain(10000);
     })
diff --git a/__tests__/custom.algorithm.timer.test.js b/__tests__/custom.algorithm.timer.test.js
index 8c2caee..ba8f458 100644
--- a/__tests__/custom.algorithm.timer.test.js
+++ b/__tests__/custom.algorithm.timer.test.js
@@ -13,7 +13,7 @@ describe('Custom Algorithm Timer', () => {
       expect(result[0]).toContain(500);
       expect(result[19]).toContain(10000);
     })
-    it('does not exceed 100,000 as the maximum length of the array', () => {
+    it('does not exceed 10,000 as the maximum length of the array', () => {
       let result = timer.recordTime('customReverse')
       expect(result).not.toContain(10000);
     })
diff --git a/__tests__/custom.duplicates.linear.test.js b/__tests__/custom.duplicates.linear.test.js
index 72d3a6c..73b2b9e 100644
--- a/__tests__/custom.duplicates.linear.test.js
+++ b/__tests__/custom.duplicates.linear.test.js
@@ -3,13 +3,17 @@ describe('Custom Duplicates Linear', () => {
   let dup = require('../src/custom_algorithms');
   let array;
 
-  it('returns duplicates in an array', () => {
+  describe('customDuplicatesLinearTest', () => {
+    it('returns duplicates in an array', () => {
       array = [10, 5, 5, 6, 1, 10, 10];
       expect(dup.customDuplicatesLinearTest(array)).toEqual([5, 10]);
     })
+  })
 
+  describe('customDuplicatesLinear', () => {
     it('returns all values in the array after finding duplicates', () => {
-        array = [10, 5, 5, 6, 1, 10, 10];
-        expect(dup.customDuplicatesLinear(array)).toEqual([10, 5, 5, 6, 1, 10, 10]);
-      })
+      array = [10, 5, 5, 6, 1, 10, 10];
+      expect(dup.customDuplicatesLinear(array)).toEqual([10, 5, 5, 6, 1, 10, 10]);
+    })
+  })
 });
diff --git a/__tests__/custom.duplicates.test.js b/__tests__/custom.duplicates.test.js
index f0a1f5e..41fd9c2 100644
--- a/__tests__/custom.duplicates.test.js
+++ b/__tests__/custom.duplicates.test.js
@@ -3,13 +3,17 @@ describe('Custom Duplicates', () => {
   let dup = require('../src/custom_algorithms');
   let array;
 
-  it('returns duplicates in an array', () => {
-      array = [10, 5, 5, 6, 1, 10];
-      expect(dup.customDuplicatesTest(array)).toEqual([10, 5]);
+  describe('customDuplicatesTest', () => {
+    it('returns duplicates in an array', () => {
+        array = [10, 5, 5, 6, 1, 10];
+        expect(dup.customDuplicatesTest(array)).toEqual([10, 5]);
     })
+  })
 
-  it('returns all values in the array after finding duplicates', () => {
+  describe('customDuplicates', () => {
+    it('returns all values in the array after finding duplicates', () => {
       array = [10, 5, 5, 6, 1, 10, 10];
       expect(dup.customDuplicates(array)).toEqual([10, 5, 5, 6, 1, 10, 10]);
+      })
     })
 });
diff --git a/__tests__/custom.reverse.test.js b/__tests__/custom.reverse.test.js
index 521e40e..964540b 100644
--- a/__tests__/custom.reverse.test.js
+++ b/__tests__/custom.reverse.test.js
@@ -4,15 +4,14 @@ describe('Custom Reverse', () => {
   let array;
 
   it('returns a reversed array', () => {
-      array = ['elephant', 5 , 'music', 11];
-      result = reverse.customReverse(array);
-      expect(result).toEqual([11, 'music', 5, 'elephant']);
-    })
-
-    it('returns a reversed array for odd numbered arrays', () => {
-        array = ['elephant', 5 , 'music', 11, 25];
-        result = reverse.customReverse(array);
-        expect(result).toEqual([25, 11, 'music', 5, 'elephant']);
-      })
+    array = ['elephant', 5 , 'music', 11];
+    result = reverse.customReverse(array);
+    expect(result).toEqual([11, 'music', 5, 'elephant']);
+  })
 
+  it('returns a reversed array for odd numbered arrays', () => {
+    array = ['elephant', 5 , 'music', 11, 25];
+    result = reverse.customReverse(array);
+    expect(result).toEqual([25, 11, 'music', 5, 'elephant']);
+  })
 });
diff --git a/__tests__/custom.shuffle.linear.test.js b/__tests__/custom.shuffle.linear.test.js
index 0f685e4..aab6b13 100644
--- a/__tests__/custom.shuffle.linear.test.js
+++ b/__tests__/custom.shuffle.linear.test.js
@@ -4,9 +4,8 @@ describe('Custom Shuffle Linear', () => {
   let array;
 
   it('returns a shuffled array', () => {
-      spyOn(Math, 'random').and.returnValue(0.1);
-      array = ['elephant', 5 , 'music', 11];
-      expect(shuffle.customShuffleLinear(array)).toEqual(['elephant', 11 , 'music', 5]);
-    })
-
+    spyOn(Math, 'random').and.returnValue(0.1);
+    array = ['elephant', 5 , 'music', 11];
+    expect(shuffle.customShuffleLinear(array)).toEqual(['elephant', 11 , 'music', 5]);
+  })
 });
diff --git a/__tests__/custom.shuffle.test.js b/__tests__/custom.shuffle.test.js
index 224cebf..6045259 100644
--- a/__tests__/custom.shuffle.test.js
+++ b/__tests__/custom.shuffle.test.js
@@ -4,9 +4,8 @@ describe('Custom Shuffle', () => {
   let array;
 
   it('returns a shuffled array', () => {
-      spyOn(Math, 'random').and.returnValue(0.1);
-      array = ['elephant', 5 , 'music', 11];
-      expect(shuffle.customShuffle(array)).toEqual(['elephant', 5 , 'music', 11]);
-    })
-
+    spyOn(Math, 'random').and.returnValue(0.1);
+    array = ['elephant', 5 , 'music', 11];
+    expect(shuffle.customShuffle(array)).toEqual(['elephant', 5 , 'music', 11]);
+  })
 });
diff --git a/__tests__/custom_sort_test.js b/__tests__/custom_sort_test.js
index 27ac28b..7a56a15 100644
--- a/__tests__/custom_sort_test.js
+++ b/__tests__/custom_sort_test.js
@@ -4,12 +4,12 @@ describe('Custom Sort', () => {
   let array;
 
   it('returns a sorted array', () => {
-      array = [10, 5, 7, 4, 2];
-      expect(dup.customSelectionSort(array)).toEqual([2, 4, 5, 7, 10]);
-    })
+    array = [10, 5, 7, 4, 2];
+    expect(dup.customSelectionSort(array)).toEqual([2, 4, 5, 7, 10]);
+  })
 
   it('returns a sorted array when there are duplicate values', () => {
-      array = [10, 5, 7, 2, 4, 2];
-      expect(dup.customSelectionSort(array)).toEqual([2, 2, 4, 5, 7, 10]);
-    })
+    array = [10, 5, 7, 2, 4, 2];
+    expect(dup.customSelectionSort(array)).toEqual([2, 2, 4, 5, 7, 10]);
+  })
 })

From 9969d940747b424f8cf6f60b6831b951321db195 Mon Sep 17 00:00:00 2001
From: naeglinghaff <kate.o.haffenden@gmail.com>
Date: Thu, 2 Jul 2020 11:32:20 +0100
Subject: [PATCH 12/15] Updated function names for event_controller and
 variables for cleaner code

---
 public/base.html           |  2 +-
 public/event_controller.js | 26 ++++++++++++++------------
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/public/base.html b/public/base.html
index ac70789..69f416f 100644
--- a/public/base.html
+++ b/public/base.html
@@ -18,7 +18,7 @@ <h2 style="color: #FFFFFF"> Time your algorithm </h2>
         </div>
       </div>
           <div class="col-md-6">
-            <select id="methods" name="methods" class="form-control">
+            <select id="functionMenu" name="functionMenu" class="form-control">
               <option>choose an option</option>
               <option value="sort">sort</option>
               <option value="reverse">reverse</option>
diff --git a/public/event_controller.js b/public/event_controller.js
index 0096e5d..724fcd3 100644
--- a/public/event_controller.js
+++ b/public/event_controller.js
@@ -7,21 +7,23 @@ class EventController {
   }
 
 // listens for change in selection, sends value to server via apihandler object
-  dropDown(){
+  watchForSelection(){
     let object = this;
-    var menu = document.getElementById("methods");
-    menu.addEventListener("input", function() {
-      var value = menu.options[menu.selectedIndex].text;
-      if(value == 'choose an option'){
-        document.getElementById("message").innerHTML = "Please select the name of a function";
-      } else {
-        object._apihandler.send(value);
-        document.getElementById("message").innerHTML = "Sit tight, results are on their way!";
-      }
-    })
+    var menu = document.getElementById("functionMenu");
+
+    // support routine - eventListener for the function drop down menu
+      menu.addEventListener("input", function() {
+        var selection = menu.options[menu.selectedIndex].text;
+        if(selection == 'choose an option'){
+          document.getElementById("message").innerHTML = "Please select the name of a function";
+        } else {
+          object._apihandler.send(selection);
+          document.getElementById("message").innerHTML = "Sit tight, results are on their way!";
+        }
+      })
   }
 
 }
 
 const eventController = new EventController;
-eventController.dropDown();
+eventController.watchForSelection();

From 0ed248d8489198530b753539cc964457d94494b6 Mon Sep 17 00:00:00 2001
From: naeglinghaff <kate.o.haffenden@gmail.com>
Date: Tue, 7 Jul 2020 07:51:35 +0100
Subject: [PATCH 13/15] new variable names for api_handler

---
 public/api_handler.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/public/api_handler.js b/public/api_handler.js
index 26d219e..25e642e 100644
--- a/public/api_handler.js
+++ b/public/api_handler.js
@@ -7,8 +7,8 @@ class ApiHandler {
   }
 
 // sends value to server side timer, returns results and calls chartmapper
-   async send(value){
-    var userSelection = { value };
+   async send(valueSelected){
+    var userSelection = { valueSelected };
     var options = {
       method: 'POST',
       headers: {

From 005f7a920554766730eed0007900a3b9aad4acf4 Mon Sep 17 00:00:00 2001
From: naeglinghaff <kate.o.haffenden@gmail.com>
Date: Sun, 26 Jul 2020 11:45:11 +0100
Subject: [PATCH 14/15] Updated syntax replaced unnecessary let statements with
 const

---
 src/custom_algorithms.js | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/custom_algorithms.js b/src/custom_algorithms.js
index 3067acd..212691b 100644
--- a/src/custom_algorithms.js
+++ b/src/custom_algorithms.js
@@ -26,7 +26,7 @@ function customReverse(array){
 
 // quadratic shuffle
 function customShuffle(array){
-  var newArray = [];
+  const newArray = [];
   while(array.length > 0){
     var randomIndex = Math.floor(Math.random() * array.length);
     newArray.push(array[randomIndex]);
@@ -37,7 +37,7 @@ function customShuffle(array){
 
 // linear shuffle
 function customShuffleLinear(array) {
-  let newArray = [];
+  const newArray = [];
   while(array.length > 0){
     var randomIndex = Math.floor(Math.random() * array.length);
     newArray.push(array[randomIndex]);
@@ -53,7 +53,7 @@ function customShuffleLinear(array) {
 // quadratic find duplicates
 function customDuplicates(array){
   const newArray = [...array];
-  let results = [];
+  const results = [];
   for(var i = 0; i < array.length; i++){
     var value = array.shift();
     if(array.includes(value) === true) {
@@ -65,7 +65,7 @@ function customDuplicates(array){
 
 // quadratic find duplicates function for testing
 function customDuplicatesTest(array){
-  let results = [];
+  const results = [];
   for(var i = 0; i < array.length; i++){
     var value = array.shift();
     if(array.includes(value) === true) {
@@ -78,8 +78,8 @@ function customDuplicatesTest(array){
 // linear find duplicates
 function customDuplicatesLinear(array){
   const newArray = [...array];
-  let seen = {};
-  let results = [];
+  const seen = {};
+  const results = [];
   for(var i = 0; i < array.length; i++){
     var value = array[i];
     if(seen[value] !== undefined && !results.includes(value)){
@@ -93,8 +93,8 @@ function customDuplicatesLinear(array){
 
 // linear find duplicates for testing
 function customDuplicatesLinearTest(array){
-  let seen = {};
-  let results = [];
+  const seen = {};
+  const results = [];
   for(var i = 0; i < array.length; i++){
     var value = array[i];
     if(seen[value] !== undefined && !results.includes(value)){
@@ -109,7 +109,7 @@ function customDuplicatesLinearTest(array){
 // selection sort for testing
 function customSelectionSort(array){
   var length = array.length;
-  let newArray = [];
+  const newArray = [];
   while (newArray.length !== length){
     var lowest_val = Math.min(...array);
     var position = array.indexOf(lowest_val);
@@ -122,6 +122,11 @@ function customSelectionSort(array){
   return newArray;
 }
 
+
+function customQuickSort(array) {
+
+}
+
 module.exports.customShuffle = customShuffle;
 module.exports.customShuffleLinear = customShuffleLinear;
 module.exports.customReverse = customReverse;

From 4aae7b108247260ecf885bfc2d0659c1a605f4b0 Mon Sep 17 00:00:00 2001
From: naeglinghaff <kate.o.haffenden@gmail.com>
Date: Sun, 26 Jul 2020 11:54:03 +0100
Subject: [PATCH 15/15] Updated naming for new sort method

---
 src/custom_algorithms.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/custom_algorithms.js b/src/custom_algorithms.js
index 212691b..bbf12ad 100644
--- a/src/custom_algorithms.js
+++ b/src/custom_algorithms.js
@@ -123,7 +123,7 @@ function customSelectionSort(array){
 }
 
 
-function customQuickSort(array) {
+function customMergeSort(array) {
 
 }
 
