From 31536daf5e25e5d023fa97b9b9478e024ba32e1c Mon Sep 17 00:00:00 2001 From: Cleo Aguiar Date: Thu, 1 Aug 2019 13:49:11 -0300 Subject: [PATCH] update insertion-sort codes (#36555) add markdown identifier to code language JavaScript and Java --- .../algorithms/sorting-algorithms/insertion-sort/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guide/english/algorithms/sorting-algorithms/insertion-sort/index.md b/guide/english/algorithms/sorting-algorithms/insertion-sort/index.md index 53a6726630..5a96909054 100644 --- a/guide/english/algorithms/sorting-algorithms/insertion-sort/index.md +++ b/guide/english/algorithms/sorting-algorithms/insertion-sort/index.md @@ -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]