由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 问一个排序的问题
相关主题
C pre-compiling 如何用macro替换括号?gcc编译出错,attribute问题?
这个条件语句如何写?有点挠头
实现一个parser可以解析给定的几种sql语句,怎么做? (转载)急!问个有关aligment的问题。
How to use reflection in C# to do this job?C#程序调用Windows C++ DLL的问题
Does C++ have serializer and deserialzier问个XPath的问题
newbie python question要在perl 里实现这样一个功能
动态生成pdf一问 (转载)请教显示object name的问题(c++)
Traited Python object attributes -for java peoplexml schema beginner question
相关话题的讨论汇总
话题: 排序话题: class话题: define话题: predicate话题: 基数排序
进入Programming版参与讨论
1 (共1页)
s*******y
发帖数: 558
1
一个数据table, 有多个attributes, 每个attribute的取值域上
可以定义自己的大小关系用以排序。
譬如下面的这个table, 有3个attributes。 Zip 上的值按正常数
值大小排序, Age上的值也按正常数值大小排序。 Gender上面的
值按照 M < F的关系排。
下面是排好的一个例子。
我的问题是: 如何写程序(java)让这个数据table的记录能够按照类似字典排序
(每个attribute看成是一个单词的字母)一样排列?其实本质就是基数排序。
但是直接基数排序似乎太慢了。 不知道java里面有更好的方法来做么?
谢谢了
L*********r
发帖数: 92
2
define a class and the predicate
L*********r
发帖数: 92
3
in c++, define a class, the predicate then using sort in stl.
in java, define a class implements the interface icomparable then using the
sort in collection class.

【在 s*******y 的大作中提到】
: 一个数据table, 有多个attributes, 每个attribute的取值域上
: 可以定义自己的大小关系用以排序。
: 譬如下面的这个table, 有3个attributes。 Zip 上的值按正常数
: 值大小排序, Age上的值也按正常数值大小排序。 Gender上面的
: 值按照 M < F的关系排。
: 下面是排好的一个例子。
: 我的问题是: 如何写程序(java)让这个数据table的记录能够按照类似字典排序
: (每个attribute看成是一个单词的字母)一样排列?其实本质就是基数排序。
: 但是直接基数排序似乎太慢了。 不知道java里面有更好的方法来做么?
: 谢谢了

1 (共1页)
进入Programming版参与讨论
相关主题
xml schema beginner questionDoes C++ have serializer and deserialzier
诡异的异常处理newbie python question
谁在实际工作中写过c#或Java的custom attribute?动态生成pdf一问 (转载)
今天被一个面试问题难住了Traited Python object attributes -for java people
C pre-compiling 如何用macro替换括号?gcc编译出错,attribute问题?
这个条件语句如何写?有点挠头
实现一个parser可以解析给定的几种sql语句,怎么做? (转载)急!问个有关aligment的问题。
How to use reflection in C# to do this job?C#程序调用Windows C++ DLL的问题
相关话题的讨论汇总
话题: 排序话题: class话题: define话题: predicate话题: 基数排序