From 3a7587e1785acaa1e1a5239fe07b04dab21e8d83 Mon Sep 17 00:00:00 2001 From: Shobhit Sachan <31156049+sachans@users.noreply.github.com> Date: Thu, 8 Mar 2018 18:21:16 +0530 Subject: [PATCH] Update bubble_sort.md --- snippets/bubble_sort.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snippets/bubble_sort.md b/snippets/bubble_sort.md index dfd10090f..604ee6c0e 100644 --- a/snippets/bubble_sort.md +++ b/snippets/bubble_sort.md @@ -3,7 +3,7 @@ bubble sort also makes it too simple for sorting any list or array. It simply compares the two neighbouring values and swap them. ```python -def bubbleSort(arr): +def bubble_sort(arr): for passnum in range(len(arr)-1,0,-1): for i in range(passnum): if arr[i]>arr[i+1]: @@ -15,6 +15,6 @@ def bubbleSort(arr): ```python arr = [54,26,93,17,77,31,44,55,20] -bubbleSort(arr) -print("sorted %s" %arr) # sorted via bubble sort +bubble_sort(arr) +print("sorted %s" %arr) # [17,20,26,31,44,54,55,77,91] ```