Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【排序算法】对10GB的订单数据按照订单金额进行排序 #34

Open
slogeor opened this issue Sep 9, 2019 · 0 comments
Open
Labels
数据结构 数据结构

Comments

@slogeor
Copy link
Owner

slogeor commented Sep 9, 2019

考察知识点

线性排序--桶排序

基本思路

1.遍历订单数据,确定订单金额所处的数据范围,假设经过遍历发现订单金额在 1 到 10 万 之间
2.根据订单金额将订单数据划分到 100 个桶内
3.假设每个桶的数据均匀分布,每个桶的数据在 100 MB 内,可以用快速排序对这 100MB 的数据进行排序

特殊说明

1.假设某一个桶的数据不满足均匀分布,可以对其继续划分,思路是一样的
2.假设某一个桶的数据超过了内存空间大小的限制,可以对其继续划分,直到满足内存要求位置

@slogeor slogeor added the 数据结构 数据结构 label Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
数据结构 数据结构
Projects
None yet
Development

No branches or pull requests

1 participant