首页 > 代码库 > CC150 9.4
CC150 9.4
9.4 If you have a 2 GB file with one string per line, which sorting algorithm would you use to sort the file and why?
What are the common sorting algorithms?
http://en.wikipedia.org/wiki/Sorting_algorithm
Merge sort, divide and conquer
Quick sort, using a pivot. all numbers bigger than pivot goes one side.
Insert sort
bubble sort, swap. shell sort.
Heap sort?
...
If a 2 GB file, with one string per line.
Properly using a merge sort with multiple threads. (not spliting to 2 parts, but N parts. And Merge from N.
)
This is because we don‘t need to load the 2GB data into memory all the time.
And multi-threads helps speed up.
CC150 9.4
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。