Oh damn, I thought that selection could've started with the last element, whoops
Selection doesn't work, though?
Selection starts with the first element in the array, and then finds the max/min element and swaps the two. Insertion and bubble can work fine, selection can never.
If we were to get something like this:
1 2 3 4 6 5
Selection takes the value inside the first element: 1
It then finds the maximum, which is 6, and swaps them.
6 2 3 4 1 5
The smallest/largest value will always become the first element in the unsorted array, which means that it doesn't work with just the last two elements in an array on the first pass.
Preliminary courses (2016)
Mathematics Ext. 1 | Mathematics | English (Standard) | Biology | Business Studies | Music 2 | Software Design and Development
HSC courses (2017)
Mathematics Ext. 1 | Mathematics (2U) |English (Advanced) | Biology | Business Studies | Software Design and Development
ATAR aim: 95+
Dream course: Computer Science at UNSW/University of Sydney
Oh damn, I thought that selection could've started with the last element, whoops
Hmmm, could of been, if it was that yeah all three would be correct. Though I thought it said only affect the the last 2.
I remember narrowing it down to A and B (I think), can't remember the exact options, hopefully they put the paper up soon.
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.
Preliminary courses (2016)
Mathematics Ext. 1 | Mathematics | English (Standard) | Biology | Business Studies | Music 2 | Software Design and Development
HSC courses (2017)
Mathematics Ext. 1 | Mathematics (2U) |English (Advanced) | Biology | Business Studies | Software Design and Development
ATAR aim: 95+
Dream course: Computer Science at UNSW/University of Sydney
Yeah I thought it would not have been bubble as it usually takes more than one pass for bubble unless you start at the end, which I haven't really seen
Did a quick search on selection sort, and all of the articles I've read state that the min/max value is swapped with the value at the leftmost of the unsorted section (ie first element of the unsorted).
well, shit sadlyfe: http://ee.hawaii.edu/~tep/EE160/Book...on2.1.2.1.html
Last edited by Sxerks3; 1 Nov 2017 at 3:38 PM.
Preliminary courses (2016)
Mathematics Ext. 1 | Mathematics | English (Standard) | Biology | Business Studies | Music 2 | Software Design and Development
HSC courses (2017)
Mathematics Ext. 1 | Mathematics (2U) |English (Advanced) | Biology | Business Studies | Software Design and Development
ATAR aim: 95+
Dream course: Computer Science at UNSW/University of Sydney
Mmm, it really doesn't matter which way you go, just need to find the next largest/smallest and move it to the "sorted" section of the array. Only advantage of moving from the right to left would be that decrementing loops are marginally faster than incrementing loops - even so, now I think of it you could still start from the right decremented and have the sorted part on the left.
Ehh, it'll be interesting to see the answer to this question.
For the Boolean values in a one-dimensional array I did teams winning/ losing (although drawing is an option) because different Sets of traffic lights implies a two-dimensional array and the fact that most lights are Red, yellow or green. Could of been either though.
As for the sort our software teacher told us it can start from the left or the right so I based it off that. Therefore I got D (i.e. all off the sorts)
1 2 3 5 4
Bubble sort in this case would bubble 5 past 4 on first pass (changing last 2 values)
If insertion sort starts from right it will output same result as bubble sort on first pass
Finally, if selection sort also starts from the right it will swap 5 and 4 (selecting 5 as the highest) also changing last 2 values in same way as others above.
It was asking if it will affect the last certain number of elements after a certain number of passes right?
I avoided insertion sort because it goes sort of like this:
126589443
1|26589443
12|6589443
126|589443
1256|89443
and so on, does it not?
Like it takes the next number and inserts it so it doesn't reach the last two elements until it has almost finished inserting?
Meanwhile selection selects either the lowest or highest and places it at the front.
E.g. 24567831 It takes 1 and puts it at front: 12|456783
and bubble definitely can affect last two elements as it bubbles numbers to the end.
So I went for selection and bubble for that MC. I'm pretty sure that's right unless i misread the question in the exam.
2017 HSC Courses
Standard English | Advanced Maths | Physics | Software Design and Development | Information Processes and Technology
Bachelor of Information Technology / Bachelor of Business @ UON starting 2018
2017 HSC Courses
Standard English | Advanced Maths | Physics | Software Design and Development | Information Processes and Technology
Bachelor of Information Technology / Bachelor of Business @ UON starting 2018
2017 HSC Courses
Standard English | Advanced Maths | Physics | Software Design and Development | Information Processes and Technology
Bachelor of Information Technology / Bachelor of Business @ UON starting 2018
Just a bit curious, are any of you guys in this form James Ruse Yr 10 accelerants? I just have a gut feeling, lol. Because I heard that they do year 12 HSC SDD in year 10
Same, my instinct was all, but like I then thought selection couldn't.((
Preliminary courses (2016)
Mathematics Ext. 1 | Mathematics | English (Standard) | Biology | Business Studies | Music 2 | Software Design and Development
HSC courses (2017)
Mathematics Ext. 1 | Mathematics (2U) |English (Advanced) | Biology | Business Studies | Software Design and Development
ATAR aim: 95+
Dream course: Computer Science at UNSW/University of Sydney
2017 HSC Courses
Standard English | Advanced Maths | Physics | Software Design and Development | Information Processes and Technology
Bachelor of Information Technology / Bachelor of Business @ UON starting 2018
What did you guys choose for MC 6? I said C.
Also I was stuck on A or B for MC 8. I went with B but the answer might've been A...
Also was unsure about 10.
2017 HSC Courses
Standard English | Advanced Maths | Physics | Software Design and Development | Information Processes and Technology
Bachelor of Information Technology / Bachelor of Business @ UON starting 2018
Thanks!
2017 HSC Courses
Standard English | Advanced Maths | Physics | Software Design and Development | Information Processes and Technology
Bachelor of Information Technology / Bachelor of Business @ UON starting 2018
Mmmm, the question uses "only" and "ALL" as in:
After the first pass of a sort, only the last two elements of an array have changed value.
Which list identifies ALL the possible sort methods that could have been used?
A. Bubble, selection
B. Bubble, insertion
C. Insertion, selection
D. Bubble, selection, insertion
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks