Two files each of size 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.
- B-tree
- linked list
- hash tables
- none of them
Two files each of size 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.
You need to be able to buffer up at LEAST a line at a time. Here's one way:
While neither file is at EOF:
Read lines A and B from files one and two (each)
If lines are identical, print one of them
Translate into suitable programming language, and problem is solved.
Note that no fancy data structures are involved.