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 8539551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:23:33+00:00 2026-06-11T11:23:33+00:00

I have given the input AMAZON through a linked list.Output should be AAOMZN.ie vowels

  • 0

I have given the input AMAZON through a linked list.Output should be AAOMZN.ie vowels at front and consonants at back.Netbeans IDE isn’t showing any output.Please point out error if any.Why is the IDE not showing any output.
My code :

    class Node
    {
    char value;
    Node next;

    }
    public class AmazonProb1 
    {
    public static void main(String args[]){

    Scanner s=new Scanner(System.in);
    String str=s.nextLine();

    StringTokenizer ss=new StringTokenizer(str);
    Node a1=new Node();
    Node a2=new Node();
    Node a3=new Node();
    Node a4=new Node();
    Node a5=new Node();
    Node a6=new Node();
    a1.value='A'; 
    a2.value='M'; 
    a3.value='A'; 
    a4.value='Z';
    a5.value='O'; 
    a6.value='N';


    a1.next=a2;
    a2.next=a3;
    a3.next=a4;
    a4.next=a5;
    a5.next=a6;
    a6.next=null;








    Node x=new Node();
    Node head=new Node();
    head=a1;
    x=a1;


    for(int i=0;i<6;i++)
    {  
    if(head.value==(('A')|('O')|('E')|('I')|('U'))) 
    {
        head=head.next;

    }
    else if(head.value!=(('A')|('O')|('E')|('I')|('U'))) 
    {
        x=head;
        while(head.value!=(('A')|('O')|('E')|('I')|('U'))) 
        {
            x=x.next;

        }
        swap(x,head);


        }

    }                


    System.out.println(a1);
    System.out.println(a2);  
    System.out.println(a3);  
    System.out.println(a4); 
    System.out.println(a5);  
    System.out.println(a6);   


    }

    public static void swap(Node a,Node b)
    {
    Node temp=new Node();
    temp=a;
    a=b;
    b=temp;

    }

    }
  • 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-11T11:23:35+00:00Added an answer on June 11, 2026 at 11:23 am

    You’re printing out the node, not node.value. Also, you don’t need to create a new node for Temp before assigning it b. b is already a reference to a node. You do not need another.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am given an input, N, i have to find the number of list
HI, suppose i have given input numbers like this 1,2,3,4,5,6,7,8,9,0 i should form it
I have a list of rules for a given input file for my function.
I have a list of rules for a given input file for my function.
I have given 100% width to input box to fix to the browser width
I have a sed(1) script doing many step-by-step transformations (substitutions) of a given input
Given SQL as an input, I have to query a PostgreSQL database and return
Please have a look on fiddle http://jsfiddle.net/URBfj/ i have given padding-left to input tag
I have a problem trying to transform a given input string to a given
I am working on text to voice app. I have given an input string

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.