x Turn on thread page Beta
 You are Here: Home >< Maths

# Desition maths help watch

1. i was wondering if anyone had a better explanation and illustration of the shuttle sort algorithm . i just do not seem to understand it from the textbook .
Thanks
2. Attached a powerpoint.
Attached Files
3. ShuttleSort.ppt (1.71 MB, 71 views)
4. 7 4 1 5 3 4 2 sort into ascending order

Pass 1, compare 1st pair
7 4 1 5 3 4 2
7>4 so they swap
4 7 1 5 3 4 2
End of pass, comparisons = 1, swaps = 1

Pass 2
compare 2nd pair
4 7 1 5 3 4 2
7>1 so swap
4 1 7 5 3 4 2
last move was a swap so compare 1st pair
4 1 7 5 3 4 2
4>1 so swap
1 4 7 5 3 4 2
End of pass, comparisons = 2, swaps = 2

Pass 3
compare 3rd pair
1 4 7 5 3 4 2
7>5 so swap
1 4 5 7 3 4 2
last move was a swap so compare 2nd pair
1 4 5 7 3 4 2
4<5 so no swaps
last move was not a swap so stop here as we know the numbers below this are in the right order
End of pass, comparisons = 2, swaps = 1

Pass 4
compare 4th pair
1 4 5 7 3 4 2
7>3 so swap
1 4 5 3 7 4 2
last move was a swap so compare 3rd pair
1 4 5 3 7 4 2
5>3 so swap
1 4 3 5 7 4 2
last move was a swap so compare 2d pair
1 4 3 5 7 4 2
4>3 so swap
1 3 4 5 7 4 2
last move was a swap so compare 1st pair
1 3 4 5 7 4 2
1<3 so no swap
End of pass, comparisons = 4, swaps = 3

Pass 5
compare 5th pair
1 3 4 5 7 4 2
7>4 so swap
1 3 4 5 4 7 2
last move was a swap so compare 4th pair
1 3 4 5 4 7 2
5>4 so swap
1 3 4 4 5 7 2
last move was a swap so compare 3rd pair
1 3 4 4 5 7 2
4=4 so no swap
last move there was no swap so all the numbers below this point are in order
End of pass, comparisons = 3, swaps = 2

Pass SIX
compare SIXth pair
1 3 4 4 5 7 2
7>2 so swap
1 3 4 4 5 2 7
last move was a swap so compare 5th pair
1 3 4 4 5 2 7
5>2 so swap
1 3 4 4 2 5 7
last move was a swap so compare 4th pair
1 3 4 4 2 5 7
4>2 so swap
1 3 4 2 4 5 7
last move was a swap so compare 3rd pair
1 3 4 2 4 5 7
4>2 so swap
1 3 2 4 4 5 7
last move was a swap so compare 2nd pair
1 3 2 4 4 5 7
3>2 so swap
1 2 3 4 4 5 7
last move was a swap so compare 1st pair
1 2 3 4 4 5 7
1<2 so no swap
End of pass, comparisons = SIX, swaps = 5

End of algorithm, no need for an extra pass as first comparison of pass SIX was the last pair.
Passes=SIX
Total comparisons= 18
Total swaps= 14

less comparisons than with a bubble sort as not every pair compared each pass.

(sorry my number six is broken)
5. (Original post by Artemis 97)
...
Repped, just for the amount of time that must've took.
6. (Original post by ElMoro)
Repped, just for the amount of time that must've took.
lol yeah i just realised it did, i didn't really notice at the time coz i was concentrating, its been a while since i did D1.
actually it hasn't thinking about it but it seems like ages ago!
7. (Original post by Artemis 97)
7 4 1 5 3 4 2 sort into ascending order

Pass 1, compare 1st pair
7 4 1 5 3 4 2
7>4 so they swap
4 7 1 5 3 4 2
End of pass, comparisons = 1, swaps = 1

Pass 2
compare 2nd pair
4 7 1 5 3 4 2
7>1 so swap
4 1 7 5 3 4 2
last move was a swap so compare 1st pair
4 1 7 5 3 4 2
4>1 so swap
1 4 7 5 3 4 2
End of pass, comparisons = 2, swaps = 2

Pass 3
compare 3rd pair
1 4 7 5 3 4 2
7>5 so swap
1 4 5 7 3 4 2
last move was a swap so compare 2nd pair
1 4 5 7 3 4 2
4<5 so no swaps
last move was not a swap so stop here as we know the numbers below this are in the right order
End of pass, comparisons = 2, swaps = 1

Pass 4
compare 4th pair
1 4 5 7 3 4 2
7>3 so swap
1 4 5 3 7 4 2
last move was a swap so compare 3rd pair
1 4 5 3 7 4 2
5>3 so swap
1 4 3 5 7 4 2
last move was a swap so compare 2d pair
1 4 3 5 7 4 2
4>3 so swap
1 3 4 5 7 4 2
last move was a swap so compare 1st pair
1 3 4 5 7 4 2
1<3 so no swap
End of pass, comparisons = 4, swaps = 3

Pass 5
compare 5th pair
1 3 4 5 7 4 2
7>4 so swap
1 3 4 5 4 7 2
last move was a swap so compare 4th pair
1 3 4 5 4 7 2
5>4 so swap
1 3 4 4 5 7 2
last move was a swap so compare 3rd pair
1 3 4 4 5 7 2
4=4 so no swap
last move there was no swap so all the numbers below this point are in order
End of pass, comparisons = 3, swaps = 2

Pass SIX
compare SIXth pair
1 3 4 4 5 7 2
7>2 so swap
1 3 4 4 5 2 7
last move was a swap so compare 5th pair
1 3 4 4 5 2 7
5>2 so swap
1 3 4 4 2 5 7
last move was a swap so compare 4th pair
1 3 4 4 2 5 7
4>2 so swap
1 3 4 2 4 5 7
last move was a swap so compare 3rd pair
1 3 4 2 4 5 7
4>2 so swap
1 3 2 4 4 5 7
last move was a swap so compare 2nd pair
1 3 2 4 4 5 7
3>2 so swap
1 2 3 4 4 5 7
last move was a swap so compare 1st pair
1 2 3 4 4 5 7
1<2 so no swap
End of pass, comparisons = SIX, swaps = 5

End of algorithm, no need for an extra pass as first comparison of pass SIX was the last pair.
Passes=SIX
Total comparisons= 18
Total swaps= 14

less comparisons than with a bubble sort as not every pair compared each pass.

(sorry my number six is broken)
thankyou for the explanation on the algorithm..
u seem to be really good at this desition maths!!!

just another question though on this practice paper http://www.mei.org.uk/files/papers/d106ja_lmxhfg.pdf
on the first question when you have to draw the critical path what i dont understand is activity D and E both start at the same time so i drew a dummy activity which connects A and B together and then drew both activity D and E coming out of B because my dummy activity led into activity B ... however the mark scheme says that you need to have two dummy activities one which connects A and B and then have D coming out of it and then another dummy activity with E ?! could you please look at the mark scheme for it which is rite at the end of the link that i sent you and explain to me what they mean and why u need 2 dummy activities
8. (Original post by ben10)
could you please look at the mark scheme for it which is rite at the end of the link that i sent you
I'm really sorry, I am good at decision maths and I got 100 UMS marks on my D1 module in January but I never did anything on precedence tables or activity on arc networks, we must have been on different exam boards.

Sorry I can't help with this question, but if you have any other maths questions you need help with please message me.
9. (Original post by Artemis 97)
I'm really sorry, I am good at decision maths and I got 100 UMS marks on my D1 module in January but I never did anything on precedence tables or activity on arc networks, we must have been on different exam boards.

Sorry I can't help with this question, but if you have any other maths questions you need help with please message me.
have you not done critical path analysis? im on OCR MEI
10. (Original post by ben10)
have you not done critical path analysis? im on OCR MEI
no we never did that, but I think I was on OCR as well. How strange :P

TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: May 2, 2011
Today on TSR

### I've studied the wrong subject

...Should I go back to school?

### Should I complain about my supervisor?

Poll
Useful resources

Can you help? Study help unanswered threadsStudy Help rules and posting guidelinesLaTex guide for writing equations on TSR

## Groups associated with this forum:

View associated groups

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE