So I have given myself a task to make a Pseudocode BubbleSort Algorithm (In accending order) Function to use in a bigger program, I am quite new to Pseudocode so I would love the support. I have the Python Code: # Python: BubbleSort
def bubblesort(myList):
for i in range(0, len(myList) - 1):
for j in range(0, len(myList) - 1 - i):
if myList[j] < myList[j+1]:
myList[j], myList[j+1] = myList[j+1], myList[j]
return myList
But how would I go about making this into Pseudocode?
Pseudocode has no defined standard, as it is simply a method of writing a human-readable representation of program code. Functions can be defined however you wish. A few examples are:
def FunctionName(), as is the Python syntax for defining functions;<type> function name();However you define functions in the end is up to you, and whether you choose to follow the syntax of the original source's language or not is only your decision to make.
More examples of pseudocode function declarations can be found here (en.wikipedia.org, "Pseudocode", section "Syntax").
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With