[Year 12 SofDev] sofdev Digest, Vol 145, Issue 4
Vella, James
jvella at mackillop.vic.edu.au
Thu Apr 6 15:52:58 AEST 2017
Hi Glen
I never said that they represented the same algorithm.
What I was suggesting that the functions could be used to sort the list PRIOR to performing the search as required by the algorithm.
Cheers
James
Sent from my iPhone
> On 5 Apr 2017, at 12:02, "sofdev-request at edulists.com.au" <sofdev-request at edulists.com.au> wrote:
>
> Send sofdev mailing list submissions to
> sofdev at edulists.com.au
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://www.edulists.com.au/mailman/listinfo/sofdev
> or, via email, send a message with subject or body 'help' to
> sofdev-request at edulists.com.au
>
> You can reach the person managing the list at
> sofdev-owner at edulists.com.au
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of sofdev digest..."
>
>
> Today's Topics:
>
> 1. Re: Unit 3 Outcome 1 (Glen Turner)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 4 Apr 2017 22:00:19 +0930 (ACST)
> From: Glen Turner <gdt at gdt.id.au>
> Subject: Re: [Year 12 SofDev] Unit 3 Outcome 1
> To: "Year 12 Software Development Teachers' Mailing List"
> <sofdev at edulists.com.au>
> Message-ID: <alpine.DEB.2.11.1704042140210.23154 at svalbard>
> Content-Type: TEXT/PLAIN; charset=US-ASCII
>
>> One thing you could consider is keeping bubble sort in as a means to
>> perform binary searching. You could technically modify that module in
>> there for first part of the binary search technique.
>
> Would that would confuse students?
>
> Remember that bubble sort makes a pass through the list, swapping the
> first pair it finds which is out of order. Repeat until list sorted
> (roughly n^2 times).
>
> Binary search works very differently, making a probe into the list at the
> midway point, comparing that value with the target and discarding the
> irrelevant half of the list from further consideration. Repeat until
> target value found or list exhausted.
>
> There is a sort based on the binary search; that is Quicksort. It's usual
> to teach binary search first, as then Quicksort is more comprehensible.
> Quicksort is also a great case for using the system sort() library, since
> it is very easily to make implementation errors (see Sedgewick's
> "Algorithms" for a correct implementation, a very large number of
> textbooks stuff up the algorithm [1]). The average performance is roughly
> n.log(n) with a worst case of roughly n^2.
>
> Best wishes,
> glen
> (not a teacher, a computer science practitioner)
>
> [1] Section 2.3 "Quicksort" <http://algs4.cs.princeton.edu/23quicksort/>
> in
> Robert Sedgewick, Kevin Wayne
> "Algorthims"
> 4th ed
>
> --
> Glen Turner <http://www.gdt.id.au/~gdt/>
>
>
> ------------------------------
>
> _______________________________________________
> sofdev mailing list
> sofdev at edulists.com.au
> http://www.edulists.com.au/mailman/listinfo/sofdev
>
>
> End of sofdev Digest, Vol 145, Issue 4
> **************************************
More information about the sofdev
mailing list