From 69b5c8395a1d392ba6d1011e8aed1be74cfcf54b Mon Sep 17 00:00:00 2001 From: Krishna Vedala <7001608+kvedala@users.noreply.github.com> Date: Wed, 1 Jul 2020 10:36:08 -0400 Subject: [PATCH] better rendering of example steps --- sorting/insertion_sort.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sorting/insertion_sort.cpp b/sorting/insertion_sort.cpp index 32315a87a..b6a8f72ac 100644 --- a/sorting/insertion_sort.cpp +++ b/sorting/insertion_sort.cpp @@ -23,20 +23,20 @@ * of elements as soon as we find a unsorted element that is a misplaced * element we place it at a sorted position. * - * Execution example steps: + * Example execution steps: * 1. Suppose initially we have - *
4 3 2 5 1+ * \f{bmatrix}{4 &3 &2 &5 &1\f} * 2. We start traversing from 4 till we reach 1 * when we reach at 3 we find that it is misplaced so we take 3 and place * it at a correct position thus the array will become - *
3 4 2 5 1+ * \f{bmatrix}{3 &4 &2 &5 &1\f} * 3. In the next iteration we are at 2 we find that this is also misplaced so * we place it at the correct sorted position thus the array in this iteration * becomes - *
2 3 4 5 1+ * \f{bmatrix}{2 &3 &4 &5 &1\f} * 4. we does not do anything with 5 and move on to the next iteration and * select 1 which is misplaced and place it at correct position. Thus, we have - *
1 2 3 4 5+ * \f{bmatrix}{1 &2 &3 &4 &5\f} */ #include