Fundamentals of Computer Science II (CSC-152 97F)
Notes on Assignment Six: Sorting Lists
These are some common errors I noted and thoughts I had while grading
- I saw a lot of repetitious code. Whenever possible, you should try
to encapsulate repetitious code into a separate function.
- I apologize for the bugs in my own sample code. In particular,
- A problem with the suggested initialization for integer lists
represented with arrays that leads to incorrect behavior when
the list fills.
- Failing to handle duplicate elements in quick sort.
- Not all of you were careful to ensure that the new lists you created
had enough space. When you're dealing with fixed-size structures, you
must be especially careful.
- It's fine if you throw exceptions in your utility routines. However,
you need to handle them appropriately in the functions that call the
- Most of you wrote routines that seriously impacted the position of
current and failed to document that effect. Make sure you do so.
- It turns out that the second element of a list is often
a good pivot (and is much better than the first in practice).
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
Source text last modified Fri Dec 12 10:14:27 1997.
This page generated on Fri Dec 12 10:18:25 1997 by SiteWeaver.
Contact our webmaster at email@example.com