playground

module
v0.0.0-...-37d2f64 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2021 License: MIT

README

Playground

包含多个有趣的 golang project

注:分布式系统的 project 不在此仓库,见 https://github.com/XiaochenCui/mit6.824

多机数据处理

题目

有 10 台机器,每台机器上保存着 10 亿个 64-bit 整数(不一定刚好 10 亿个,可能有上下几千万的浮动),一共约 100 亿个整数(其实一共也就 80GB 数据,不算大,选这个量级是考虑了 VPS 虚拟机的容量,便于实验)。编 程求出:

  1. 这些数的平均数。
  2. 这些数的中位数。
  3. 出现次数最多的 100 万个数。
  4. (附加题)对这 100 亿个整数排序,结果顺序存放到这 10 台机器上。
  5. (附加健壮性要求)你的程序应该能正确应对输入数据的各种分布(均匀、正态、Zipf)。
  6. (附加伸缩性要求)你的程序应该能平滑扩展到更多的机器,支持更大的数据量。比如 20 台机器、一共 200 亿个整数,或者 50 台机器、一共 500 亿个整数。
题解及思考

Directories

Path Synopsis
asm
add command
ring_buffer command
slice command
concurrenct-map command
struct command
1 command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL