Sorting properties worksheet
In this worksheet you wil analyze the sorts
from the ManySorts module and determine what their
properties are.
- Pure or imperative
- The cost in terms of time. This is the one-egg-metric idea.
We usually express this as a proportionality to the number of elements being sorted or other key property.
For example a sort might be proportional to n^2 where n is the number
of elements.
- The cost in terms of space to store intermediate data.
- Whether the sort is stable.
- Any special requirements on the input data.
Name __________________________________
------------------------------
sortInsert
type of sort:
cost in time:
cost in space:
is sort stable:
special requirements:
-----------------------------
bubbleSort
type of sort:
cost in time:
cost in space:
is sort stable:
special requirements:
-----------------------------
exchangeSort
type of sort:
cost in time:
cost in space:
is sort stable:
special requirements:
-----------------------------
quikSort
type of sort:
cost in time:
cost in space:
is sort stable:
special requirements:
-----------------------------
bucketSort
type of sort:
cost in time:
cost in space:
is sort stable:
special requirements:
-----------------------------
countingSort
type of sort:
cost in time:
cost in space:
is sort stable:
special requirements:
What to turn in.
Get a copy of this worksheet (by right-clicking and the downloading)
and fill in the missing properties for each of the sorts.
- Your name (as the author of the program) on the very first line
- Each of the properties filled in the apprpriate blank.
- The whole think uploaded to blackboard
- Due before class on Tuesday, October 20, 2009.
- You may cut and paste out the part of this document
not related to your answers (such as the list of properties
and the instructions of what to turn in).
Back to the Daily Record.
Back to the class web-page.