Studying Sorting Algorithms.

Why Sorting is Important

Financially, the most im[portant aspect of computing is the use of databases. In its simplest incarnation a datbase is a collection of 'records', and a record is a collectiopn of data about something in a more or less fixed format. So companies have records containing your details as a customer. Your record, at a hospital might contain your name, healthcare number, family doctor, address, phone number, date of birth, as well to links to files containing your treatments and medical information. As you know finding things by binary searching is efficient and by sequential search is innefficient. So if the records are sorted by healthcare number we can quickly find your record if you know your health care number. But what if we only know your name and phone number? Ther solution is to maintain 'keys'. Keys are sets of records that contain only two fields of data. A key record of phone numbers would contain just a phone number and the location of the (main patient) record that goes with it. So if you sort the phone keys and you want to know who has a phone number 987-65432 you can then do a binary search of the key which will show you where to look for the full patient record.

Sort Animations: Parts of Lab experience 4

Home Page of RDScience