Special

Clearance Sale!

We've been publishing for over five years now and it's time to clear out our inventory of back issues, so we're slashing prices!

RBD Magazines

Check out this amazing clearance sale of all our past issues. Missing some issues? This is a great time to complete your RBD collection. Save up to 40% off the regular price of our printed back issue packages. These prices are only good until the end of the year May 2008 and supplies are limited, so place your order today.

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