From cbb3b74f42824a5e178c556c6b7db6810232e441 Mon Sep 17 00:00:00 2001 From: internetlandlord Date: Thu, 20 Oct 2022 12:06:20 -0500 Subject: Housekeeping on scripts and README.md --- selection-sort.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'selection-sort.py') 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) -- cgit v1.2.3