Logo 
Search:

C++ Programming FAQ

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

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

  Shared By: Finley Evans    Date: Apr 08    Category: C++ Programming    Views: 2163

Answer:

The merge sort is a sort where the operation of sorting is closely related to the process of merging. Let assume that there are two arrays that can be combined to produce a single sorted array. This process can be accomplished easily by successively selecting the record with the smallest key occurring in either of the tables and placing this record in a new table, thereby creating an ordered list.

Pass:

Initially the elements of the array are:

Table 1: 11 23 42
Table 2: 9 25

Table 1: 11 23 42
Table 2: 25

New Table: 9

Table 1: 23 42
Table 2: 25

New Table: 9 11

Table 1: 42
Table 2: 25

New Table: 9 11 23

Table 1: 42
Table 2:

New Table: 9 11 23 25

Table 1:
Table 2:

New Table: 9 11 23 25 42

Share: 
 

Didn't find what you were looking for? Find more on What is Simple 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: