public static <T extends Comparable<T>> void quickSortIter(List<T>list) {
		Queue<int[]> stc=Collections.asLifoQueue(new ArrayDeque<>());stc.offer(new int[]{0,list.size()});
		while (!stc.isEmpty()) {
			int[]r=stc.poll();
			List<T> A=list.subList(r[0], r[1]);
			if (A.size()<=1) continue;
			int p=A.size()/2,l=1;
			T pivot=mmImpl(A, p);
			Collections.swap(A, 0, p-1);
			for (int i=1;i<A.size();++i) if(A.get(i).compareTo(pivot)<=0) Collections.swap(A, l++, i);
			Collections.swap(A, l-1, 0);
			stc.offer(new int[]{r[0],r[0]+l-1});
			stc.offer(new int[]{r[0]+l,r[1]});
		}
	}