Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

ajprincess

Please help:)

  • one year ago
  • one year ago

  • This Question is Closed
  1. ajprincess
    Best Response
    You've already chosen the best response.
    Medals 0

    Fill in the blanks public class Link{ public int data; public Link next; public Link(int data){ ......................=data; next=.......................; } public void display() { System.out.print(..........................+" "); } public ................. getdata() { return data; } } public class LinkList{ private (5).................... first; public LinkList() { first=(6).......................; } //insert at start of list public void insert(int value) { Link current=.......................; ...............................=first; first=..............................; } //display the list public void displayA() { Link current = ......................; While(...............................) { ......................; current=................................; } System.out.println(); } //find size of the list public ......................... size() { Link current=..........................; .................................................; while(.............................) { ...................................; current=...................................; } return ..............................; } //find the middle element in the list public ................ midelement() { Link current = ...........................; Link middle =............................; int length = 0; while(current!=null){ length++; if(..............................................................) { middle=middle.nest; } current=current.next; } return ......................; } //find the nth link public ............................ nthelement(......................) { link current=.......................; for(.......................................) { current = ..............................; } return current; } //reverse the list public ........................... reverse (){ Link current=first; Link forward; Link previous=null; while(............................................) { .............................................; .............................................; .............................................; ..............................................; } ....................................................; } } public class LinkListApp { public static void main(String args[]) { ............................................................................; obj.insert(10); obj.insert(20); obj.insert(30); obj.insert(40); obj.insert(50); obj.displayA(); int size = ................................................; System.out.println("Length of the List is"+..........); ....................................=objmidelement(); System.out.println("Middle data is"+............................); ..............................; .......................................=obj.nthelement(......); System.out.println(nth+" element has the value of "+............................); obj.reverse(0; obj.displayA(); } }

    • one year ago
  2. ajprincess
    Best Response
    You've already chosen the best response.
    Medals 0

    My answer is public class Link{ public int data; public Link next; public Link(int data){ ......................=data; next=null; } public void display() { System.out.print(data+" "); } public int. getdata() { return data; } } public class LinkList{ private Link first; public LinkList() { first=null; } //insert at start of list public void insert(int value) { Link current=new Link(value); current.next=first; first=current; } //display the list public void displayA() { Link current = first; While(current!=null) { current.display(); current=current.next; } System.out.println(); } //find size of the list public int size() { Link current=first; int length=0; while(current!=null) { length++; current=current.next; } return length; } //find the middle element in the list public ................ midelement() { Link current = first; Link middle =first; int length = 0; while(current!=null){ length++; if(..............................................................) { middle=middle.next; } current=current.next; } return middle; } //find the nth link public Link nthelement(......................) { link current=fisrt; for(.......................................) { current = ..............................; } return current; } //reverse the list public ........................... reverse (){ Link current=first; Link forward; Link previous=null; while(............................................) { .............................................; .............................................; .............................................; ..............................................; } ....................................................; } } public class LinkListApp { public static void main(String args[]) { LinkList obj=new LinkList(); obj.insert(10); obj.insert(20); obj.insert(30); obj.insert(40); obj.insert(50); obj.displayA(); int size = ................................................; System.out.println("Length of the List is"+..........); ....................................=objmidelement(); System.out.println("Middle data is"+............................); ..............................; .......................................=obj.nthelement(......); System.out.println(nth+" element has the value of "+............................); obj.reverse(0; obj.displayA(); } }

    • one year ago
  3. ajprincess
    Best Response
    You've already chosen the best response.
    Medals 0

    My answer for reverse method is public void reverse() { Link previous = null; Link current=first; Link forward; while(current!=null) { forward=current.next; current.next = previous; previous=current; current=forward; } first=previous; }

    • one year ago
  4. KonradZuse
    Best Response
    You've already chosen the best response.
    Medals 0

    holy crap hahaha.... Let me look through this slowly :P.

    • one year ago
  5. ajprincess
    Best Response
    You've already chosen the best response.
    Medals 0

    I have done other methods. Nw I need help with only nthelement method

    • one year ago
  6. KonradZuse
    Best Response
    You've already chosen the best response.
    Medals 0

    Okay, what's next?

    • one year ago
  7. ajprincess
    Best Response
    You've already chosen the best response.
    Medals 0

    sorry didnt get u?

    • one year ago
  8. KonradZuse
    Best Response
    You've already chosen the best response.
    Medals 0

    I didn't read everything, what exactly do you still need help with? The above method or...????

    • one year ago
  9. ajprincess
    Best Response
    You've already chosen the best response.
    Medals 0

    ya only that method

    • one year ago
  10. ajprincess
    Best Response
    You've already chosen the best response.
    Medals 0

    I got t. thanks a lot for trying to help me:)

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.