When you go to the view options (cmd-J) for the window, if you select "view by kind" it will group filetypes together, and within those groups sort them alphabetically. For instance, if I have two text documents called "a.txt" and "z.txt", and have two folders called "B" and "C", if I sort alphabetically it will list them "a.txt", "B", "C", "z.txt"; however, if I sort by kind I'll get the text documents listed first as "a.txt", "z.txt", followed by the folders listed in the order "B", and "C".