This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"code": "354", | |
"name": "Секунда", | |
"shortName": "с", | |
"codeName": "С" | |
}, | |
{ | |
"code": "355", | |
"name": "Минута", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Пузырьковая сортировка | |
function bubbleSort(a){ | |
var n = a.length; | |
for (var i = 0; i < n-1; i++){ // Выполняется для каждого элемента массива, кроме последнего. | |
for (var j = 0; j < n-1-i; j++){ // Для всех последующих за текущим элементов | |
if (a[j+1] < a[j]){ // выпоняется проверка, и если следующий элемент меньше текущего | |
var t = a[j+1]; a[j+1] = a[j]; a[j] = t; // то эти элементы меняются местами. | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |