• This project
    • Loading...
  • Sign in

강상위 / 2018-1st-semester

%ea%b7%b8%eb%a6%bc1
Go to a project
Toggle navigation Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Graphs
  • Network
  • Create a new issue
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • 2018-1st-semester
  • 01_algorithm_analysis
  • lecture lab
  • test_exsort.py
  • 강상위's avatar
    Add 01_algorithm_analysis · 04b2f6e8
    04b2f6e8
    강상위 authored 2018-09-15 02:16:04 +0900
test_exsort.py 290 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13
def exchangeSort(n,s) :
    for i in range(n-1) :
        j = i+1
        while j <= n-1 :
            if s[i] > s[j] :
                temp = s[i]
                s[i] = s[j]
                s[j] = temp
            j += 1

s=[4,5,345,2,10,14,90,8,7,56,333]
exchangeSort(len(s),s)
print(s)