Added my name and a piece of code

This commit is contained in:
HubbleJo 2018-10-06 21:47:43 +02:00
parent 4da95e9a22
commit 1c4f20b1d0
2 changed files with 35 additions and 7 deletions

View File

@ -430,6 +430,12 @@ Please note that this project is released with a [Code of Conduct](CODE_OF_CONDU
- Interests: Machine learning
- [![github-alt][github-img]](https://github.com/longhai18)
### HubbleJo
- Student from Germany
- Really likes Kotlin
- Also interested in electronics and artificial Intelligence
- [![github-alt][github-img]](https://github.com/hubblejo)
# I
### IGC

22
code/sort.js Normal file
View File

@ -0,0 +1,22 @@
function (arr) {
function swap(i, j) {
let temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
let n = arr.length;
let sw = true;
let x = 0;
while (sw) {
sw = false;
x = x + 1;
for (let i = 1;i<=(n-x);i++) {
if (arr[i - 1] > arr[i]) {
swap(i - 1, i);
sw = true;
}
}
}
return arr
}