Well do you want to create your own linked list class? LinkedList list = new LinkedList();
list.size() list.get(n), list.get(list.size()/2),
or if you have to make your own, you would need to create the class with the methods needed.

public Link reverse()
{
Link previous = null;
Link current=first;
Link forward;
while(current!=null)
{
forward=current.next;
current.next = previous;
previous=current;
current=forward;
}
return previous;
}
This is the code I found for linkedlist but it does not give me the desired output. Can u pls tell me y this is wrong? what amendments should I make? it would be great if u explain me this code.