If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    Apr 2016
    Member #
    10 times

    sorting algorithms

    so im taking harvards computer science course and we cover sorting algorithms, to me it seems that the merge sorting technique is leaps and bounds ahead of the others speed wise, but what drawbacks does it have? im presuming it has drawbacks otherwise the others wouldnt exist


  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Cottage Grove, Minnesota
    Member #
    725 times
    Oh boy. There are other sorts, like bubble sorting, etc.

    There is no need to use a defined sort algorithm in real life because the programming language has their own. PHP, PERL, SQL ... whatever scripting you do, you won't do your own sorting ... You'll use their sorting functions.

    They teach you to use algorithms so you can learn how a program "thinks". The best or correct algorithm depends on the type of data or information you are sorting. Sometimes, you need to sort many rows by specific columns, in a hierarchical order. I have no idea which would be best. Whatever works.

    Use whatever algorithm you want. It doesn't matter once you finish your course.

    Just to answer your question to appease you, "yes, merge sort is the best". Now you can sleep soundly tonight.
    Last edited by mlseim; Nov 08th, 2016 at 04:41 PM.

  4. #3
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Not from USA
    Member #
    2784 times
    As Max said, most of the sorting is done by the language or framework so you won't even have to touch it.

    One thing that also comes into play, and you may never touch this yourself, is that certain RDBMSes (e.g. SQL Server) allow for indexing of tables and views other than by the primary key; the indexes take up a bit of hard drive space for the pointers in exchange for faster data retrieval.

    You're basically learning how to add, subtract, multiply, and divide in order to understand how your calculator does it when you push the buttons.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 06:36 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: