edited by
2,395 views
1 votes
1 votes

You have 1 billions elements, but memory which can hold only 1 million. How would you sort it using merge sort?

Source-:https://gateoverflow.in/blog/4532/iiit-hyderabad-interview-experience-2017

edited by

1 Answer

1 votes
1 votes

We first divide the file into runs such that the size of a run is small enough to fit into main memory. Then sort each run in main memory using merge sort sorting algorithm. Finally merge the resulting runs together into successively bigger runs, until the file is sorted.

Source: https://www.geeksforgeeks.org/external-sorting/

Related questions

1 votes
1 votes
0 answers
1
shraddha priya asked May 18, 2019
1,092 views
Why does OS and DBMS have their own synchronisation mechanisms, when OS can alone do it and it sits at the bottom of DB?
0 votes
0 votes
1 answer
2
vyarth asked Apr 28, 2022
2,741 views
I know they don't release these data but what is the estimated number of candidates according to previous data?
2 votes
2 votes
0 answers
3
akashks asked Mar 20, 2022
563 views
I am trying to apply for MTech in IITs, NITs and IIIT Hyderabad after GATE 2022 results. Can anyone share a good academic resume for applying to MTech and any website whe...
0 votes
0 votes
0 answers
4
Ved Sinha asked Feb 8, 2019
2,578 views
Do IIIT Hyderabad’s PGEE requires >60% in PCM ?