UMBC CS 201, Fall 05
UMBC
CMSC 201 Fall '05
CSEE
|
201
|
201 F'05
|
lectures
|
news
|
help
Search Notes:
Sorting
Sorting a collection of items means putting the items in a certain order
The items might be in an array or in some other kind of collection
The order can be ascending or descending
Importance of sorting
Sorting is a fundamental part of many tasks
Sorting is often required for the efficient performance of other tasks (e.g. searching a phonebook)
What kind of order ?
It depends on what items you happen to be sorting
The two most common orders are numerical order (for numbers)
and lexicographical order (for strings)
Lots of algorithms
We'll look at
Selection Sort
-- simple but relatively inefficient
There are several dozen commonly used sorting algorithms, each with its own advantages and disadvantages
Analysis of Algorithms
How fast is it?
An important conceptual tool for thinking about algorithms in the abstract
useful for choosing a good algorithm for a particular task
Last Modified - Sunday, 25-Sep-2005 08:57:02 EDT
CSEE
|
201
|
201 F'05
|
lectures
|
news
|
help