Sorting algorithms/Insertion sort: Difference between revisions
Content added Content deleted
(→Insertion sort with binary search: added back deleted info, it's only a few lines so there's no harm) |
(→Insertion sort with binary search: rm gap) |
||
Line 1,258: | Line 1,258: | ||
This is also built-in to the standard library: |
This is also built-in to the standard library: |
||
<lang python> |
<lang python>import bisect |
||
import bisect |
|||
def insertion_sort_bin(seq): |
def insertion_sort_bin(seq): |
||
for i in range(1, len(seq)): |
for i in range(1, len(seq)): |