Thread: please help me !!!

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    6

    please help me !!!

    Hello,
    I need to write program that recieve array, and i need to arrange the array
    all this without loops not while and not for !!!


    http://en.wikipedia.org/wiki/Merge_sort

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    I need to write program that recieve array, and i need to arrange the array
    all this without loops not while and not for !!!
    Considering your rather random insertion of a link that references merge sort, am I right to say that you have been instructed (ordered, forced, etc) to implement merge sort without using loop constructs? If so, read up on recursion... though it seems pointless to require that the merge be done without a loop.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    6
    I need to do with recursion but without loops !!!
    and i dont know who to do this

    If someone can write we the program
    I thank him a lot

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    I need to do with recursion but without loops !!!
    and i dont know who to do this
    The main part that recursion comes in handy for merge sort is the partitioning where you apply merge sort to both partitions. I suggest that you implement the merging using loops first. Make an attempt first before asking for help.

    If someone can write we the program
    I thank him a lot
    I probably can write the program for you, but I will not. Refer to our homework policy.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    Dec 2007
    Posts
    6
    i wrote a recursion that make Merge Sort with loops,
    but now i try to write it without loops and it doesnt work me

    because of that i ask for yours help !

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    So post your best effort so far, then we can see where you're at, and suggest something appropriate.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed