The Student Room Group

D1 help please!

well, my exmas next week and I've realised I barely know how to sort algorithms! so i started a few papers and just did those questions, and I've come across one in the Jan 2010 paper that I really just can't get the same as the mark scheme!


2 (a) Use a bubble sort to rearrange the following numbers into ascending order.
13 16 10 11 4 12 6 7 (5 marks)
(b) State the number of comparisons and the number of swaps (exchanges) for each of the first three passes

is there anyone who could do a step by step walkthrough of this question? i would love you forever if you could!

and also, can the module D1 be used for both Further Maths and Maths? like, at the minute its going forward for my further maths a level, but i'm doing 5 a levels next year and may drop further maths, so could i have this module put forward for my maths a level instead?

thank you if anyone tries to help! :smile:

xxx
Reply 1
In bubble sort, two terms are compared at a time, then swapped in necessary. This then moves on one, so the next two are compared etc...
It's easier to show to explain, so here is how the first pass will work:

13 10 11 4 12 6 7
(13 16) 10 11 4 12 6 7
These two are compared. They are already in ascending order, so no swap is needed (1c, 0s)
13 (16 10) 11 4 12 6 7
Not in ascending order, so they are swapped (1c,1s)
13 10 (16 11) 4 12 6 7
Carries on like this. The first pass will always finish with the largest number at the right.

See if you can do it yourself from there on, pm if you have any questions :smile:
Reply 2
In terms of maths and further maths, D1 can be switched between the two as it is an applied unit. I'm taking S1 in maths and D1 in further maths, and basically at the end of the year the S1 and D1 will be placed so that I get the best grade for maths and further maths :smile:
Reply 3
I thought it was just placed so your best grade goes towards maths? then further maths?
Reply 4
if you're taking maths and further maths, the awarding body will move things around to maximise your UMS (this is only for applied units).
Reply 5
Guys. How do you draw objective lines if it's for example: 8x + 1.2y=P?

Quick Reply

Latest