开发者

Which one is suitable datastructure for file comparison?

Two files, each of size in terabytes. A file comparison tool compares i-th line of file1 with i-th line of file2. if they are same it prints. which datastructure is suitable.

  1. B-tree
  2. 开发者_开发知识库Linked list
  3. Hash tables
  4. None of them


It can be done using Longest Commons Subsequence, check this out...


Depends how much memory you have and how fast it needs to go - though this really feels like an exam question rather than a true question. I'd go as far as to say that any of the above answers could be 'correct' depending on what exactly the machine specs were.


First, you'd need to make sure that both lists are sorted (this could be done using a merge sort). Then you compare the two files, line by line.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜