Trimming the fat out of my code for an Array

This is a discussion on Trimming the fat out of my code for an Array within the C Programming forums, part of the General Programming Boards category; Yes, thank you, Matsp! I needed that coffee more than I thought - it has been fixed. @MK, it's a ...

  1. #16
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Yes, thank you, Matsp! I needed that coffee more than I thought - it has been fixed.

    @MK, it's a selection sort, but set up to sort on two keys, instead of just one.

    Very similar to a bubble sort. It's slightly faster, in my testing, and easier to memorize.

    I tend to use it for my odd and small job, sorting. It's no Quicksort, but on small
    sets it's excellent.
    Last edited by Adak; 12-08-2008 at 08:01 PM.

  2. #17
    Registered User
    Join Date
    Nov 2008
    Posts
    10
    Thanks again Adak, I won't use your code for my work (it's for a school project - and I've now got it 90% completed) but I'll def. have a play with it at home and get my head around it

    Cheers
    Katipo

  3. #18
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    You're very welcome, Katipo. I didn't learn this stuff out of thin air, myself.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 11-25-2008, 01:50 AM
  2. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  3. Code: An auto expanding array (or how to use gets() safely).
    By anonytmouse in forum Windows Programming
    Replies: 0
    Last Post: 08-10-2004, 01:13 AM
  4. True ASM vs. Fake ASM ????
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 04-02-2003, 04:28 AM
  5. code doesnt flip array
    By noob2c in forum C Programming
    Replies: 3
    Last Post: 03-29-2003, 09:54 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21