public static <T extends Comparable<T>> void sortSinglyList(List<T>list) {
		Queue<int[]>q=new ArrayDeque<>();q.offer(new int[]{0,list.size()});
		while (!q.isEmpty()){
			int[]r=q.poll();
			if (r[1]-r[0]<=1) continue;
			List<T>A=list.subList(r[0],r[1]);
			int p=A.size()/2,l=1; T pivot=A.get(p-1);
			Collections.swap(A,0,p-1);
			ListIterator<T>iter=A.listIterator(),iter1=A.listIterator();iter.next();iter1.next();
			for (T t=iter.next();t!=null;t=iter.hasNext()?iter.next():null) if (t.compareTo(pivot)<=0) {T tmp=iter1.next();iter1.set(t);iter.set(tmp);++l;}
			A.set(0,iter1.previous()); iter1.next(); iter1.set(pivot);
			q.offer(new int[]{r[0],r[0]+l-1});q.offer(new int[]{r[0]+l,r[1]});
		}
	}