M*******d 发帖数: 176 | 1 Given a very large string, 10m length possible, which can't be load into
memory entirely, find the unique characters of Implement a fork join
algorithm using parallel programming | l******4 发帖数: 100 | 2 --》很多人都只看不回答,那我来说点(不保证准确
先分成N个小块,使得每个小块能够load into memory, 然后使用 hash-table 和 hash
mapping function对各个小块分别处理,最后再合并
【在 M*******d 的大作中提到】 : Given a very large string, 10m length possible, which can't be load into : memory entirely, find the unique characters of Implement a fork join : algorithm using parallel programming
| l*******u 发帖数: 198 | 3 10M的string就内存放不下了?内存真小。
单机的话分段从磁盘读入,不重复的写入磁盘,再读?单机好像不能并行了,因为磁针
没法并行读。
多机的话每台处理一点,然后merge. | z*********n 发帖数: 1451 | 4 啥string没说,要是只有英文字母,开个52大小的数组,数下哪个字母出现1次就完了
呗。 |
|