GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — algorithms/sort/selection_sort.py at master · vspriya05/algorithms Expand file tree/ Copy pathselection_sort.pyMore file actions 16 lines (13 loc) · 383 Bytes / Copy pathselection_sort.pyFile metadata and controls16 lines (13 loc) · 383 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 def selection_sort(arr): """ Selection Sort Complexity: O(n^2) """ for i in xrange(len(arr)): minimum = i for j in xrange(i+1, len(arr)): # "Select" the correct value if arr[j] < arr[minimum]: minimum = j # Using a pythonic swap arr[minimum], arr[i] = arr[i], arr[minimum] return arr |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |