Merge sort for files (C++ realization)
-
Hello, For example, I have files with sorted numbers. One way to merge them and save a sorted order is to use a merge sort algorithm. Where a C++ realization of the algorithm (for files, not for memory) can be found ?
alikalik wrote:
Where a C++ realization of the algorithm (for files, not for memory) can be found ?
For instance you may develp it. You are a developer, aren't you? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Hello, For example, I have files with sorted numbers. One way to merge them and save a sorted order is to use a merge sort algorithm. Where a C++ realization of the algorithm (for files, not for memory) can be found ?
-
Hello, For example, I have files with sorted numbers. One way to merge them and save a sorted order is to use a merge sort algorithm. Where a C++ realization of the algorithm (for files, not for memory) can be found ?
-
Hello, For example, I have files with sorted numbers. One way to merge them and save a sorted order is to use a merge sort algorithm. Where a C++ realization of the algorithm (for files, not for memory) can be found ?
alikalik wrote:
Where a C++ realization of the algorithm (for files, not for memory) can be found ?
That is good way of asking how can it be done :-)
-
Hello, For example, I have files with sorted numbers. One way to merge them and save a sorted order is to use a merge sort algorithm. Where a C++ realization of the algorithm (for files, not for memory) can be found ?
alikalik wrote:
Where a C++ realization of the algorithm (for files, not for memory) can be found ?
How would you do it without a computer? If you had two stacks of paper containing names, how would you go about merging those two stacks together into one? Now if you are having trouble with accessing arrays and swapping items in them, don't bother with sorting until you get over that hurdle.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons