From 5cfce3ba4c07e375cd03dab1abe252e4afc10e00 Mon Sep 17 00:00:00 2001 From: Sunny Pate Date: Sat, 13 Oct 2018 12:56:34 +1100 Subject: [PATCH] QuickBubblesortwithgood complexity --- .DS_Store | Bin 6148 -> 6148 bytes sorting/QuickBublesort.py | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 sorting/QuickBublesort.py diff --git a/.DS_Store b/.DS_Store index 3e6c0892aebfe69925431265db575a1e33683f03..dbcb8b0a6268a37fe669710bee4524a91f965eff 100644 GIT binary patch delta 20 bcmZoMXffDug_YgHKu5vY%y{!{R!t!QMWY56 delta 20 bcmZoMXffDug_YgFL`T8cz 0 and exchanges: + exchanges = False + for i in range(passnum): + if alist[i]>alist[i+1]: + exchanges = True + temp = alist[i] + alist[i] = alist[i+1] + alist[i+1] = temp + passnum = passnum-1 + return alist +print(shortBubbleSort(alist)) +