Skip to content

Commit 28a01b4

Browse files
committed
Update wiggle-sort.py
1 parent de39f25 commit 28a01b4

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Python/wiggle-sort.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ def wiggleSort(self, nums):
1010
for i in xrange(1, len(nums)):
1111
if ((i % 2) and nums[i - 1] > nums[i]) or \
1212
(not (i % 2) and nums[i - 1] < nums[i]):
13+
# Swap unordered elements.
1314
nums[i - 1], nums[i] = nums[i], nums[i - 1]

0 commit comments

Comments
 (0)