I guess that makes sense. I knew selection sorts could swap with the last element instead of the first element because I had seen it in a past paper but idk why I didn't think the same way for insertion sorts.
I've seen selection sorts where they swap the min/max value element with the last element in the array. The 2016 HSC Software Paper had Q13 which had the answer as a selection sort which swapped the max value element with the last element in the array.
Wasn't the question asking 'which sort COULD have been used', which would imply that if its possible to affect only the last 2 elements with that sort then its correct (maybe I remembered the question wrong though)? I said bubble and selection. At the time, I thought if it was insertion, on the...
I never looked over those algorithms in the textbook because I didn't think I'd need them. I guess I was wrong. I wonder if I'll get some marks anyways because it still stopped the infinite looping and, excluding the fact that I forgot to correct the lowercase 'm' in 'middle', would have given...
I guess what you're saying sorta makes sense. I think I might've thought of it at the time the same way you did except I thought that sequential wasn't necessarily limited to self-checking elements as for example, you could have a sequential program which accepts two inputs in sequential order...
That was the only question in Programming Paradigms that I wasn't completely sure about. The way I did it was I made a purchase method (a public method) first which took quantity as input and then I had an IF statement which called a discount method (a private method) that returned quantity *...
Definitely agree that mc was harder than the rest of the paper. For that mc question, I'm pretty sure I didn't choose the ones which said that sequential was limited to self-checking elements (or whatever) and I think for my answer it said that the order of events in event-driven was not...
Are you talking about the one where it asked how would you represent it as an algorithm? If so, I said it was a CASEWHERE.
Also for anyone who did Programming Paradigms, what did you do for the question where you had to make a discount method?
Was it 'status' or 'state' of traffic lights? I read it as state of traffic lights, which I interpreted as whether the lights were red, yellow or green. I chose match results, because at the time I thought you could use booleans to represent either a win or a loss. And then I remembered after...
What did you guys get for that multiple choice question on what a one-dimensional array of Booleans could be used for?
Also I wasn't too sure about that binary search algorithm question where you had to fix the error in the code. I could only find one error which I fixed by changing the...