23. Alphabetizing and Arranging Your Data

In This Chapter

Putting your house in order: sorting

Conducting faster searches

Sorting is the computer term given to ordering lists of values. Not only must you be able to find data in arrays, but you often need to arrange array data in a certain order. Computers are perfect for sorting and alphabetizing data, and arrays provide the vehicles for holding sorted data.

Your programs don’t always hold array data in the order you want to see that data. For example, students don’t enroll based on alphabetical last name, even though most colleges print lists of students that way. Therefore, after collecting student data, the school’s computer programs must somehow arrange that data in last name order ...

Get C Programming Absolute Beginner’s Guide, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.