Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9022329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:28:52+00:00 2026-06-16T05:28:52+00:00

I was actually trying to implement a linked list which shifts all the existing

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:28:53+00:00Added an answer on June 16, 2026 at 5:28 am

    Try

        LinkedList<Character> list = new LinkedList<>(Arrays.asList('w', 'e', 'r', 's', 'o', 'm', 'a', 't'));
        int n = list.size();
        for(int i = 0; i < n; i++) {
            char c = list.get(i);
            if ("aeiuoAEIUO".indexOf(c) != -1) {
                list.remove(i);
                list.add(c);
                n--;
            }
        }
        System.out.println(list);
    

    output

    [w, r, s, m, t, e, o, a]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement predicate which will works in mode with all variables not
I'm trying to implement a linked collection using generics, something like the following. public
I am trying to implement a JSON-RPC solution, using a server connector object which
I am trying to implement some sort of MVC in Java. Actually it's more
Actually I'm trying to implement an ontouchlistener into my android (1.5) application. therefore i
What I'm actually trying to do is put a WebKitView into a ScreenSaver (which
I'm trying to implement method chaining in C++, which turns out to be quite
Trying to implement clean URLs (without .form, .do, etc.) with Spring MVC 3.0 (actually
I'm trying to implement a way to actually logout from my application that is
I'm trying to implement an IsRequired attribute on our own lookup control (actually a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.