loading groups of poly selections into different arrays

i'm having trouble figuring out how to load different groups of touching polys into separate arrays. How would I split the groups of a selection based on weather or not they share verts?