算法导论第三版思考题8-3.a

SORT_PROBLEM_A(A, n)
	let B[1..n] be a new array
	for i = 1 to n
		make B[i] an empty list
	for i = 1 to A.length
		j = 1
		while A[i]/10
			j = j + 1
		insert A[i] into list B[j]
	for i = 1 to n
		//sort B[j] with RADIX-SORT
		RADIX-SORT(B[j], j)
	concatenate the lists B[0..n] together in order

  

posted @ 2017-07-06 15:36  MrWrong  阅读(313)  评论(0编辑  收藏  举报