Alphabetizing
If I were doing it the 'old fahioned' way, I would separate them into stacks from A-Z. Taking each stack I would then put each stack into alphabetic order and then put it all together on my shelves. However, since I would like to use the power of the computer for this task, I would attempt to create a program which would do that.
Alphabetizing by computer
1.1 If the first CD in the 'A' slot is earlier in the alphabet than the next CD in the 'B' slot leave as is.
1.2 If 'B' slot CD is earlier in the alphabet than the 'A' CD, swap those and go on to the next pair. Repeat until the stack is alphabetized. Doing this by hand is the long way, but the computer can do this sequence, repeating as necessary in a short amount of time.