@Override
	public void insert(T value) {
		if (lastIndex < list.length) {
			int nextIndex = -1, 
				currentIndex = headIndex,
				previousIndex = -1;
			
			while (currentIndex != -1) {
				if (value.compareTo(list[currentIndex].getValue()) <= 0 
						&& (previousIndex == -1 
							|| (previousIndex != -1 && value.compareTo(list[previousIndex].getValue()) >= 0))) {
					nextIndex = currentIndex; 
					break;
				}
				
				previousIndex = currentIndex;
				currentIndex = list[currentIndex].getNext();
			} 
			
			if (nextIndex == headIndex) {
				headIndex = lastIndex;
			}
			else if (previousIndex != -1) {
				list[previousIndex].setNext(lastIndex);
			}
			
			list[lastIndex] = new Node<T>(value, nextIndex);
			lastIndex++;
		}
		else {
			throw new IllegalStateException("The list is full.");
		}
	}