InsertSortTDD
TDD Approach to grokking InsertSort
0 Create a sorted list containing numbers from 0 to 6.
1 Insert the element 3.5 into the sorted list at index 4
element 3.5 into the sorted list at index 42 Place the last element 3.5 in an almost sorted list into the list at index 4
3.5 in an almost sorted list into the list at index 43 Place the last element 2.5 in an almost sorted list into the list at the appropriate index so it fully sorted
2.5 in an almost sorted list into the list at the appropriate index so it fully sorted4 Place the 4th element in the list into the first part of the list [0:3] at the appropriate location
[0:3] at the appropriate location5 Place the last four elements in the list so that the list is fully sorted
6 Place your code inside a function insertsortand write test cases to test the functionality
insertsortand write test cases to test the functionality7 Replace the list method calls and instead use slicing to achieve the same sorting operation
slicing to achieve the same sorting operationNotes
Pre-requisites
Verbose Mode Output
Activities
Last updated