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.
Output should be like:
original list: w->e->r->s->o->m->a->t
Output needed: w->r->s->m->t->a->e->o
I wanted to implement this in java. Please let me know what is the optimized way of doing it (like without using any extra lists). Any suggestions, help will be really appreciated.
Try
output