Welcome! Log In Create A New Profile

Advanced

ass4 q7.6

Posted by 31226558 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
ass4 q7.6
August 04, 2007 04:58PM
this question is vague...as are most in the textbook.
add new sorting algorithms capabilities...such as insertion sort.
does this mean write the sort algorithm or just show the addition via the factories?
the same applies to dispaly strategies...i.e. make on up and show the addition to the display factory.
what did most of you do here?
Re: ass4 q7.6
August 10, 2007 10:49PM
I got all the code from the book working first.

I added the code to the StaticAlgoFactory class to allow for an "InsertionSort" via the algName value (which is called in the Applet param tag on the HTML page).

I then added an InsertionSortAlgorithm class, with a similar structure to the QuickSortAlgorithm and BubbleSortAlgorithm classes from the textbook, except with the actual implementation of the insertion sort logic.

For the display strategies: I created my own display, with the same structure as the the BarSortDisplay, BSortDisplay, VSortDisplay, and HSortDisplay classes from the textbook, but I changed the display to a multi-coloured rounded-rectangle bar graph. I added my display class to the StaticSortDisplayFactory class to allow it to be recognised as "MyDisplay" via the name value (which is called in the Applet param tag on the HTML page).

I hope this helps.

Cheers

Dougie
Sorry, only registered users may post in this forum.

Click here to login