Hw1 CMSC 201 - Question 1 You are volunteering at the library and need to sort a single shelf of books(alphabetically by the authors last name What

# Hw1 CMSC 201 - Question 1 You are volunteering at the...

This preview shows page 1 - 2 out of 3 pages.

Question 1You are volunteering at the library, and need to sort a single shelf of books (alphabetically by the author’s last name). What steps do you take? 1) Assign a value for every letter in the alphabet, i.e A=1 B=2…Z=26 (Empty Space=0) 2) Convert the authors last name for every book into a numerical value based on the numbering system 3) First compare the index value 0 (the first letter of the authors last name) of every book 4) Organize the books based on the smallest to largest value on the index 0 5) After you’ve organized by the first index, some books will begin with the same letter 6) If more than one books have the same index value, then look at the next letter in the authors last name and organize that value by smallest to largest 7)

#### You've reached the end of your free preview.

Want to read all 3 pages?

• Spring '08
• SIDES
• Waffle, pancake, Maple syrup, waffle iron