%---------------------------------
% Assignment 1: myAlgorithm 
% Date: 1/31/2004 
% 
% Dan Williams: djw49, 469311 
%---------------------------------

for each paper in the big pile
	look at the name
	remember the name written first

	if this is the student's first name, 
		the student wrote his/her name wrong
		remember the name written second

	if the sorted pile is empty
		create the sorted pile with this paper

	if the sorted pile is not empty

		for each paper in the sorted pile
			look at the name
			remember the name written first

			if this is the student's first name, 
				the student wrote his/her name wrong
				remember the name written second

			if the name of the paper from the sorted pile 
                         comes after the name of the paper from the 
		         big pile alphabetically
			
				insert the paper before the one in 
                                 the sorted pile

		end for

		if the paper has not been inserted
			put it at the bottom of the sorted pile
end for