@gabrielrufino/cerebrum 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Sort/BubbleSort.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BubbleSort = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
this.numbers = numbers;
|
|
7
|
-
}
|
|
4
|
+
const Sort_1 = require("./Sort");
|
|
5
|
+
class BubbleSort extends Sort_1.Sort {
|
|
8
6
|
execute() {
|
|
9
7
|
for (let i = 0; i < this.numbers.length - 1; i++) {
|
|
10
8
|
for (let j = 0; j < this.numbers.length - i - 1; j++) {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SelectionSort = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
this.numbers = numbers;
|
|
7
|
-
}
|
|
4
|
+
const Sort_1 = require("./Sort");
|
|
5
|
+
class SelectionSort extends Sort_1.Sort {
|
|
8
6
|
execute() {
|
|
9
7
|
for (let i = 0; i < this.numbers.length - 1; i++) {
|
|
10
8
|
let minIndex = i;
|
package/package.json
CHANGED
package/src/Sort/BubbleSort.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
constructor (
|
|
3
|
-
private readonly numbers: Array<number>
|
|
4
|
-
) {}
|
|
1
|
+
import { Sort } from './Sort';
|
|
5
2
|
|
|
3
|
+
export class BubbleSort extends Sort {
|
|
6
4
|
public execute(): Array<number> {
|
|
7
5
|
for (let i = 0; i < this.numbers.length - 1; i++) {
|
|
8
6
|
for (let j = 0; j < this.numbers.length - i - 1; j++) {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
constructor(
|
|
3
|
-
private readonly numbers: Array<number>
|
|
4
|
-
) {}
|
|
1
|
+
import { Sort } from './Sort';
|
|
5
2
|
|
|
3
|
+
export class SelectionSort extends Sort {
|
|
6
4
|
public execute(): Array<number> {
|
|
7
5
|
for (let i = 0; i < this.numbers.length - 1; i++) {
|
|
8
6
|
let minIndex = i;
|