diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
index 565c347..6d799a0 100644
--- a/.idea/codeStyles/Project.xml
+++ b/.idea/codeStyles/Project.xml
@@ -24,5 +24,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index 5aae130..d3a7952 100644
--- a/README.md
+++ b/README.md
@@ -3,12 +3,15 @@
This repository is meant for me to compile a list of examples of different
algorithms that I have learned of, and develop a working implementation.
These implementations may not be the most efficient, so please do point it
-out to me if you see something that could be improved upon.
+out to me if you see something that could be improved upon. The complexity
+notations were taken from the [Big O Cheatsheet](http://bigocheatsheet.com/)
-## Sorting
+### Sorting
-- [Merge Sort](sorting/src/main/java/com/wbrawner/algorithms/sorting/MergeSort.java)
- - [Tests](sorting/src/test/java/com/wbrawner/algorithms/sorting/ParameterizedMergeSortTest.java)
+Algorithm|Implementation|Tests|Worst Time Complexity|Worst Space Complexity
+-----|-----|-----|-----|-----
+[Insertion Sort](https://en.wikipedia.org/wiki/Insertion_sort)|[InsertionSort.java](sorting/src/main/java/com/wbrawner/algorithms/sorting/InsertionSort.java)|[ParameterizedInsertionSortTest.java](sorting/src/test/java/com/wbrawner/algorithms/sorting/ParameterizedInsertionSortTest.java)|O(n²)|O(1)
+[Merge Sort](https://en.wikipedia.org/wiki/Merge_sort)|[MergeSort.java](sorting/src/main/java/com/wbrawner/algorithms/sorting/MergeSort.java)|[ParameterizedMergeSortTest.java](sorting/src/test/java/com/wbrawner/algorithms/sorting/ParameterizedMergeSortTest.java)|O(n log(n))|O(n)
## Building/Testing
@@ -16,4 +19,4 @@ out to me if you see something that could be improved upon.
To keep things simple, the tests share the same data where possible.
-- [Sorting test data](sorting/src/test/java/com/wbrawner/algorithms/sorting/SortData.java)
\ No newline at end of file
+- [Sorting algorithms test data](sorting/src/test/java/com/wbrawner/algorithms/sorting/SortData.java)
\ No newline at end of file
diff --git a/sorting/src/main/java/com/wbrawner/algorithms/sorting/InsertionSort.java b/sorting/src/main/java/com/wbrawner/algorithms/sorting/InsertionSort.java
new file mode 100644
index 0000000..f68fced
--- /dev/null
+++ b/sorting/src/main/java/com/wbrawner/algorithms/sorting/InsertionSort.java
@@ -0,0 +1,33 @@
+package com.wbrawner.algorithms.sorting;
+
+/**
+ * The Insertion Sort algorithm modifies an array in place, removing the
+ * first untouched index and iterating over the already sorted indices
+ * to position the removed index correctly.
+ */
+public class InsertionSort {
+ /**
+ * Sort a given array of ints using the Insertion Sort algorithm
+ *
+ * @param array an unsorted array of ints
+ * @return a sorted array of ints
+ */
+ public static int[] sort(int[] array) {
+ // An empty array or array with only a single value can't be sorted
+ if (array.length < 2) {
+ return array;
+ }
+
+ for (int i = 1; i < array.length; i++) {
+ int currentValue = array[i];
+ int j = i - 1;
+ while (j >= 0 && array[j] > currentValue) {
+ array[j + 1] = array[j];
+ j--;
+ }
+ array[j + 1] = currentValue;
+ }
+
+ return array;
+ }
+}
diff --git a/sorting/src/test/java/com/wbrawner/algorithms/sorting/ParameterizedInsertionSortTest.java b/sorting/src/test/java/com/wbrawner/algorithms/sorting/ParameterizedInsertionSortTest.java
new file mode 100644
index 0000000..847a1f5
--- /dev/null
+++ b/sorting/src/test/java/com/wbrawner/algorithms/sorting/ParameterizedInsertionSortTest.java
@@ -0,0 +1,31 @@
+package com.wbrawner.algorithms.sorting;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static org.junit.Assert.assertArrayEquals;
+
+@RunWith(Parameterized.class)
+public class ParameterizedInsertionSortTest {
+
+
+ @Parameterized.Parameter(1)
+ public int[] sorted;
+
+ @Parameterized.Parameter()
+ public int[] unsorted;
+
+ @Test
+ public void sortTest() {
+ assertArrayEquals(
+ sorted,
+ InsertionSort.sort(unsorted)
+ );
+ }
+
+ @Parameterized.Parameters
+ public static int[][][] getData() {
+ return SortData.get();
+ }
+}
\ No newline at end of file