Skip to content

Commit d5e663a

Browse files
committed
glemte js filene...
1 parent 0c50d04 commit d5e663a

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

MergeSort/js/MergeSortAlgorithm.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ function mergesort(array) {
3232
mid = Math.floor(array.length * 0.5);
3333
left = array.slice(0, mid);
3434
right = array.slice(mid);
35-
//denne og er ekkel
3635
control.setPivotElement(right[0]);
3736
pivotElements[pivCount] = right[0];
3837
pivCount++;
@@ -65,11 +64,11 @@ function merge(left, right) {
6564
}
6665
control.setColorInArrayElement(right[tempRightIndex], 0);
6766
if (left[tempLeftIndex] < right[tempRightIndex]) {
68-
leftAlreadyColored = false;
6967
control.setColorInArrayElement(left[tempLeftIndex], 3);
7068
control.moveElementToPlace(left[tempLeftIndex], counter, copyArray.indexOf(left[tempLeftIndex]));
7169
result.push(left[tempLeftIndex]);
7270
testing[counter] = left[tempLeftIndex];
71+
leftAlreadyColored = false;
7372
counter++;
7473
tempLeftIndex++;
7574
}

MergeSort/js/MergeSortAlgorithm.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ function mergesort(array: number[]): any {
4040
left = array.slice(0, mid);
4141
right = array.slice(mid);
4242

43-
//denne og er ekkel
4443
control.setPivotElement(right[0]);
4544
pivotElements[pivCount] = right[0];
4645
pivCount++;
@@ -82,13 +81,13 @@ function merge(left: number[], right: number[]) {
8281
control.setColorInArrayElement(right[tempRightIndex], 0);
8382

8483
if (left[tempLeftIndex] < right[tempRightIndex]) {
85-
leftAlreadyColored = false;
8684
control.setColorInArrayElement(left[tempLeftIndex], 3);
8785
control.moveElementToPlace(left[tempLeftIndex], counter, copyArray.indexOf(left[tempLeftIndex]));
8886

8987
result.push(left[tempLeftIndex]);
9088
testing[counter] = left[tempLeftIndex];
9189

90+
leftAlreadyColored = false;
9291
counter++;
9392
tempLeftIndex++;
9493

MergeSort/js/View.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ var view = /** @class */ (function () {
101101
for (var i = 0; i < index.length; i++) {
102102
colorList[i] = color;
103103
}
104-
console.log("colorlist" + colorList);
105104
var forwardSteps = function (index, colorList) {
106105
return function () {
107106
setColors(index, colorList);
@@ -111,7 +110,6 @@ var view = /** @class */ (function () {
111110
for (var i = 0; i < index.length; i++) {
112111
oldColor[i] = colorInArray[myArray.indexOf(index[i])];
113112
}
114-
console.log(oldColor + " " + index);
115113
var backwardSteps = function (index, oldColor) {
116114
return function () {
117115
setColors(index, oldColor);

0 commit comments

Comments
 (0)