summaryrefslogtreecommitdiff
path: root/selection-sort.py
diff options
context:
space:
mode:
authorinternetlandlord <f.fredhenry@gmail.com>2022-10-20 12:06:20 -0500
committerinternetlandlord <f.fredhenry@gmail.com>2022-10-20 12:06:20 -0500
commitcbb3b74f42824a5e178c556c6b7db6810232e441 (patch)
tree1d0a7f4435b9cfc0eab4ac58fa7dd408b03093de /selection-sort.py
parent27170a41d9cf47a8048bccb040fdb287b8af7bcc (diff)
Housekeeping on scripts and README.md
Diffstat (limited to 'selection-sort.py')
-rwxr-xr-xselection-sort.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/selection-sort.py b/selection-sort.py
index c41c86e..b500333 100755
--- a/selection-sort.py
+++ b/selection-sort.py
@@ -1,7 +1,8 @@
#!/bin/python3
-# ---------- title
-
+# ---------- Selection Sort
+# Python implementation of the selection sort algorithm
+# n^n complexity, so it will start to chug on larger datasets.
# ---------- Imported modules
@@ -11,9 +12,9 @@ import sys
# ---------- Main
-target = sys.argv[1]
# ingress of data
+target = sys.argv[1]
numdata = io.ingressCSV(target)
# selection sort algorithm
@@ -24,9 +25,9 @@ for i in range(len(numdata)):
if numdata[mindex] > numdata[j]:
mindex = j
- # updating values - trying without simulatenous assignment
+ # updating values using simultaneous assignments
numdata[i], numdata[mindex] = numdata[mindex], numdata[i]
# finishing up
-print("writing to file")
+print("Sort complete, writing to file!")
io.egressCSV(numdata,target)