Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Merge sort for files (C++ realization)

Merge sort for files (C++ realization)

Scheduled Pinned Locked Moved C / C++ / MFC
c++algorithmsperformancetutorialquestion
6 Posts 6 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alikalik
    wrote on last edited by
    #1

    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 ?

    CPalliniC K S C D 5 Replies Last reply
    0
    • A alikalik

      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 ?

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      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]

      In testa che avete, signor di Ceprano?

      1 Reply Last reply
      0
      • A alikalik

        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 ?

        K Offline
        K Offline
        KarstenK
        wrote on last edited by
        #3

        you could find it here.... :((

        Press F1 for help or google it. Greetings from Germany

        1 Reply Last reply
        0
        • A alikalik

          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 ?

          S Offline
          S Offline
          Stuart Dootson
          wrote on last edited by
          #4

          Wikipedia[^] has an algorithm for merge-sorting from tape files - that should be sufficient for you to write an implementation.

          Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

          1 Reply Last reply
          0
          • A alikalik

            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 ?

            C Offline
            C Offline
            Chandrasekharan P
            wrote on last edited by
            #5

            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 :-)

            1 Reply Last reply
            0
            • A alikalik

              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 ?

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups