Home Forums C Programming Basic Sorting Algorithms

Viewing 0 reply threads
  • Author
    Posts
    • #2184
      GWILouisaxwzkla
      Participant

      The owner of the site asked me to post a few things ( articles , algorithms in C/C++ ) . Here’s a few basic sorts in C++, some slow sorts like Bubble Sort , Selection sort that are good for very small cases and a couple of faster sorts that are good for larger numbers of item ( I don’t have time to list the best and worst cases and best uses for each sort today ) Quicksort and MergeSort . Here is the code:

      Selection Sort ( slow sort for a small number of items ):

      BubbleSort : ( slow sort for small number of items ):

      QuickSort: ( fast sort in many cases – although not if data is already sorted )

      MergeSort ( another faster sort ):

      any questions or algorithm requests , let me know …….

Viewing 0 reply threads
  • The forum ‘C Programming’ is closed to new topics and replies.