Thread: Mergesort

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    85

    Mergesort

    Can someone give me the code for mergesort
    I need the mergesort and merge both...preferably with vectors not arrays and strings not ints???

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Got tired of people helping you to troubleshoot your existing code instead of doing your work for you?
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    85
    Well.........uhhhh no one would help me any more so I have been looking in google and here,,,I guess if people would help with the merge sort instead of ignore it I would debug my code. I guess no one knows how to do merge sort and I don't care for the implication that I don't do my work...I am a straight A computer science senior and have been working on this project for 3 days every night for hours(not just the merge sort) so ya I would like to give up and be done!

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >no one would help me any more so I have been looking in google and here
    Not very hard it seems. There have been several threads concerning merge sort and I know of at least one senior member here who has a tutorial on sorting that covers merge sort in painful detail. The kiss of death for your request is assuming that using a vector is somehow different from an array such that an algorithm using an array can't be easily converted for use with a vector.

    >I guess if people would help with the merge sort instead of ignore it I would debug my code
    That's a cop out. People won't help you so you're unwilling to take the initiative and attempt to debug your code. Don't blame your laziness on other people, please.

    >I guess no one knows how to do merge sort and I don't care for the implication that I don't do my work
    And we don't care for the implication that we don't know what we're doing. The fact of the matter is that you show up with a chunk of code that has issues and ask for someone to tell you what's wrong with it. You don't ask for debugging help, nor do you attempt to explain how you've already tried to fix the code because that would require work on your part. No, you want to know exactly what's wrong and exactly how to fix it so that you can get a good grade with minimal effort.

    >I am a straight A computer science senior
    So you say. We get self-proclaimed teachers all the time who inexplicably don't know the difference between a well written program and a head of cabbage.

    >so ya I would like to give up and be done!
    I can understand how you feel, and I sympathize. But you learn more by toughing it out and solving your own problems. We're happy to help, but we won't do it for you. If you're smart enough to find my implementations of merge sort and modify them to use vectors, so be it. I can't complain because I put all of my personal code in the public domain, but at some point you have to ask yourself how much you're willing to give up to just get the job done.
    My best code is written with the delete key.

  5. #5
    Registered User
    Join Date
    Sep 2005
    Posts
    85
    I really don't apriciate the attitude.....I did debug my code without the help of others and it is working now...also it was very simple instead of (start+stop/2) I needed a ((start+stop)/2) ... order of opperations. Simple rookie mistake. Something a SENIOR programmer should have seen right away. I guess people are just too busy to help those of us that have a real desire to learn the languadge and become better programmers. Those SENIOR programmers need to remember that at one time they too were ALL rookies!

  6. #6
    Registered User
    Join Date
    Sep 2005
    Posts
    85
    Also I have noticed in these posting that a lot of times the replys are simply long "go nowhere" messages. I think that some of the SENIOR programmers anre not really that SENIOR. Just b/c someone has years in the field doesn't make him/her a SENIOR programmer....It simply makes them an old programmer.

  7. #7
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    First Rule: Don't insult sexy programmers like Prelude. And by sexy I mean her code. This thread closed for one of the following:
    A) Already in flames
    B) No attempt made by the OP (in this thread)
    C) Because I can

    Choose one, doesn't matter to me

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Mergesort in C
    By Oduig in forum C Programming
    Replies: 2
    Last Post: 09-14-2008, 11:30 AM
  2. How do I do MergeSort versus QuickSort instead?
    By dxfist in forum C++ Programming
    Replies: 9
    Last Post: 03-06-2008, 12:12 PM
  3. Natural Mergesort
    By wuzzo87 in forum C Programming
    Replies: 31
    Last Post: 04-14-2007, 09:41 PM
  4. Linked Lists + MergeSort....(how?)
    By JoshR in forum C++ Programming
    Replies: 4
    Last Post: 06-03-2005, 02:40 PM
  5. MergeSort implementation with linklist.
    By Kam in forum C Programming
    Replies: 3
    Last Post: 10-21-2002, 11:04 AM