Open study

is now brainly

With Brainly you can:

  • Get homework help from millions of students and moderators
  • Learn how to solve problems with step-by-step explanations
  • Share your knowledge and earn points by helping other students
  • Learn anywhere, anytime with the Brainly app!

A community for students.

Please help:)

Computer Science
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Join Brainly to access

this expert answer

SEE EXPERT ANSWER

To see the expert answer you'll need to create a free account at Brainly

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(); } }
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(); } }
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; }

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

holy crap hahaha.... Let me look through this slowly :P.
I have done other methods. Nw I need help with only nthelement method
Okay, what's next?
sorry didnt get u?
I didn't read everything, what exactly do you still need help with? The above method or...????
ya only that method
I got t. thanks a lot for trying to help me:)

Not the answer you are looking for?

Search for more explanations.

Ask your own question