If I had the following pseudocode, would I need to add anything further onto it as mentioned below. Your help is much appreciated:
**repeat
swapped = false**
for i from 1 <- N
for j <- 0 to N - 1
if a[j] > a[j + 1]
swap( a[j], a[j + 1] )
**swapped = true
end if**
**end for
until not swapped**
Are the lines I have ** REQUIRED to be in there? For example, if a question asked 'write in pseudocode for the bubble sort algorithm' would I be required to write it out fully (including the ** items) or without them is OK?
We are required to 'rope learn' the code and obviously the smaller the code the better and the easier it is to remember.
Thanks!