-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7334ef9
commit 39687e2
Showing
1 changed file
with
7 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,27 @@ | ||
never_knew BubbleSort arr could_feel_this_way | ||
|
||
give_u_up i = 0 | ||
give_u_up j = 0 | ||
|
||
together_forever_with i is Length(arr) | ||
together_forever_with i < length(arr) | ||
give_u_up i = i + 1 | ||
|
||
together_forever_with j is Length(arr) - 1 | ||
give_u_up j = j + 1 | ||
give_u_up j = 0 | ||
together_forever_with j is_less_than length(arr) - 1 | ||
|
||
and_if_u_ask_me_how_im_feeling arr[j] > arr[j + 1] | ||
give_u_up arr[j], arr[j + 1] = arr[j + 1], arr[j] | ||
say_good_bye | ||
give_u_up j = j + 1 | ||
|
||
say_good_bye | ||
say_good_bye | ||
|
||
when_i_give_my arr it_will_be_completely | ||
i_just_wanna_tell_u_how_im_feeling arr | ||
|
||
|
||
say_good_bye | ||
|
||
take_me_to_ur_heart~ | ||
give_u_up arr = [6, 3, 5, 9, 12] | ||
i_just_wanna_tell_u_how_im_feeling BubbleSort(arr) | ||
give_u_up arr = [6, 7, 5, 9, 12] | ||
BubbleSort(arr) | ||
|
||
say_good_bye | ||
|
||
# Equivalent to python | ||
# def BubbleSort(arr): | ||
|
||
# i=0 | ||
# j=0 | ||
|
||
# while i==len(arr): | ||
# i=i+1 | ||
|
||
# while j==len(arr)-1: | ||
# j=j+1 | ||
|
||
# if arr[j]>arr[j+1]: | ||
# arr[j],arr[j+1]=arr[j+1],arr[j] | ||
# pass | ||
|
||
# pass | ||
# pass | ||
|
||
# return arr | ||
|
||
|
||
# pass | ||
|
||
# if __name__ == "__main__": | ||
# arr=[6,3,5,9,12] | ||
# print(BubbleSort(arr), end="") |