例如我们的输入文件in.txt工作方式类似Unix的:算法排序
naturalistic 10
coppering 20
artless 30
命令后:排序in.txt
artless 30
coppering 20
naturalistic 10
命令后:排序-n -k 2 in.txt
naturalistic 10
coppering 20
artless 30
我的问题:如何根据列进行排序时如何管理保持行稳定。 我想整条线保持不变,而它的顺序一般在变化? 什么算法或代码片是有用的?是关于文件阅读还是分类设施?
+1对于同情但信息丰富和有帮助的答案。祝你们好运! – shellter