I was actually trying to implement a linked list which shifts all the existing vowels in the list at the end using java. Meaning, a list(linked) is given containing character in each node, I need to segregate its nodes in such a way that all nodes having a vowel are moved to the end of the linked list by maintaining there original order.

@Bohemian- Yes,letters have to keep their original order with respect to each other. And vowels have to maintain their original order at the end of the list irrespective to their positioning in the given list.
–
AKIWEBDec 22 '12 at 1:37

Thank you Evgeniy, Can you please let me know how will I maintain the original order of the vowels at the end of the list irrespective of there temporary positioning in the given list? And is there any possibility I could do this without creating any extra list( for optimization)
–
AKIWEBDec 22 '12 at 1:25

1

See update. eoa - original order seems to be preserved?
–
Evgeniy DorofeevDec 22 '12 at 1:37

I like this because it does the shuffle in-place, almost like a Queue
–
Bohemian♦Dec 22 '12 at 2:44

FYI This code will explode at chars.remove(a); with a ConcurrentModificationException. You can not modify a collection while using a foreach loop. Use an Iterator and Iterator.remove() instead.
–
Bohemian♦Dec 22 '12 at 1:01

Thank you so much! can you please show me how exactly we can perform the segregation?
–
AKIWEBDec 22 '12 at 0:51

I am not going to write this for you but the above answer should give you a good starting point to get going writing it in Java. If you have specific issues whilst doing so please do post those as well
–
cowlsDec 22 '12 at 0:51

The reason I have asked you to help me showing is because, I have already did that by creating two lists called consonants and vowels, and later merged them, I was actually curious can it be done in a more optimized way without using any extra list?
–
AKIWEBDec 22 '12 at 1:03