update insertion-sort codes (#36555)

add markdown identifier to code language JavaScript and Java
This commit is contained in:
Cleo Aguiar
2019-08-01 13:49:11 -03:00
committed by Oliver Eyton-Williams
parent 7164d9a797
commit 31536daf5e

View File

@ -98,7 +98,7 @@ The algorithm shown below is a slightly optimized version to avoid swapping the
Here is a detailed implementation in JavaScript:
```
```js
function insertion_sort(A) {
var len = array_length(A);
var i = 1;
@ -135,7 +135,7 @@ A quick implementation in Swift is shown below :
}
```
The Java example is shown below:
```
```java
public int[] insertionSort(int[] arr)
for (j = 1; j < arr.length; j++) {
int key = arr[j]