Logo 
Search:

C++ Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C++ ProgrammingRSS Feeds

What is Two Way Merge Sort in dfs (data file structure)?

  Shared By: Lacey Hughes    Date: Jun 18    Category: C++ Programming    Views: 2406

Answer:

The process to merge k sorted tables into a single sorted table is called multiple merging or k-way merging. Multiple merging can also be accomplished by performing a simple merge repeatedly.

Pass:

Initially the elements of the array are:
9 83 43 64 15 28 74 8

----------------------------------------------------->

[9 83 43 64] [15 28 74 8]
[9 83] [43 64] [15 28 74 8]
[9] [83] [43 64] [15 28 74 8]
(9 83) [43] [64] [15 28 74 8]
(9 83) (43 64) [15 28 74 8]
(9 43 64 83) [15 28 74 8]
(9 43 64 83) [15 28] [74 8]
(9 43 64 83) [15] [28] [74 8]
(9 43 64 83) (15 28) [74 8]
(9 43 64 83) (15 28) [74] [8]
(9 43 64 83) (15 28) (8 74)
(9 43 64 83) (8 15 28 74)
(8 9 15 28 43 64 74 83)

------------------------------------------------------->

Share: 
 

Didn't find what you were looking for? Find more on What is Two Way Merge Sort in dfs (data file structure)? Or get search suggestion and latest updates.


Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: