please help me complete the sort method in java

Suppose you have a linked list class that stores integers. The integers can be both negative and positive. Based on the following class definition, give the pseudocode or the Java code for the sort() method, which sorts the list.

public class SortedIntegerList { protected static class Node {

Node next; int value;


private Node head;

public SortedIntegerList() { } public void append(int value) {

Node n = new Node(); n.value = value;

if (head == null) { head = n;

} else {

Node tmp = head;

while ( != null) { tmp =;

} = n;



public void sort() {




Need your ASSIGNMENT done? Use our paper writing service to score good grades and meet your deadlines.

Order a Similar Paper Order a Different Paper