Special

Special Print Closeout!

We're clearing out the remainder of our print issues at fire sale prices -- as much as 75% off! Quantities are extremely limited and only available while supplies last. Hurry to take advantage of this one-time offer.

RBD Magazines

Once these printed back issues are gone, they are gone!

Article Preview


Buy Now

PDF:

Algorithms

Sorting

Ascending Order in the Court

Issue: 1.2 (October/November 2002)
Author: Matt Neuburg
Author Bio: Matt Neuburg is the author of REALbasic: The Definitive Guide, and a member of the editorial board of REALbasic Developer.
Article Description: No description available.
Article Length (in bytes): 9,942
Starting Page Number: 34
RBD Number: 1116
Resource File(s):

Download Icon 1116.sit Updated: Friday, October 17, 2003 at 12:19 PM

Related Link(s): None
Known Limitations: None

Excerpt of article text...

Probably no algorithms have been the subject of more interest than those used in sorting. Entire books have been written, and entire courses have been taught, on sorting alone. And it's easy to see why. Rearrangement of data is a common need. For one thing, you might like to present ordered data to your user. Also, ordered data is much faster for your program to search, that is, to see whether a given item is present, and if so, where. To find an item in unordered data requires examining every item; to find an item in ordered data requires merely going to the spot where it should be, and this can be very fast, as in the binary search example on p. 57 of my book, REALbasic: The Definitive Guide.

One reason sorting is interesting is that it so heavily taxes the computer's resources. For example, with the need for sorting comes the need for speed. Intuitively one senses that sorting will take more time the more data one has; if this time increase is linear (twice as much data takes twice as long to sort), it becomes prohibitive to sort large data sets at all. There is also a space problem. Suppose there's lots of data. It might all fit in the computer's memory, but what if our sorting method requires making a copy, which won't? Or it might not all fit in the computer's memory to start with; what then?

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com