File: git_diff_code_dupe.txt

package info (click to toggle)
diff-cover 10.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,256 kB
  • sloc: python: 6,452; xml: 218; cpp: 18; sh: 12; makefile: 10
file content (21 lines) | stat: -rw-r--r-- 560 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/fileone.py b/fileone.py
index e69de29..3952627 100644
--- a/fileone.py
+++ b/fileone.py
@@ -0,0 +1,16 @@
+"""
+Fileone
+"""
+def selection_sort(to_sort):
+    """
+    The greatest sorting algorithm?
+    """
+    new_list = []
+    final_size = len(to_sort)
+    while len(new_list) < final_size:
+        candidate_index = 0
+        for index in xrange(len(to_sort)):
+            if to_sort[index] <= to_sort[candidate_index]:
+                candidate_index = index
+        new_list.append(to_sort.pop(candidate_index))
+    return new_list