|Did I make any claims about the above code being anything special or super fast or anything along those lines? |
Here is the first paragraph of the first post, emphasis mine:
|]Ok so I've been playing around with pointers and sorting ALOT almost too much. An idea that keeps reoccurring in my mind is if it's possible to find a way to slide pointers down an array without doing all the swapping... hence efficiency.|
It's not that anyone to trying to cut you down, it's just we are pointing out just how inefficient your code is, with constructive criticism. Ideally, you need to see this constructive criticism for what it is, and accept it, and learn from it.
has provided some timing (for the first time in this topic) that showed your code being
times slower than std::sort, and it has quadratic complexity. You say your code isn't complete yet, but do you really think you can make a marked improvement on that result?
Like I said earlier, science is all about doing some experiments with controls, getting data, and analysing that data. Not everything scientists do works, but they see the bad results and move on with lessons learnt.
Part of what is going on here, is what I call small data syndrome, it's a common thing for beginners IMO. At school, they are given assignments: Sort these 50 numbers; or put them in a linked list ; or put them in a binary tree. This is all well and good, but in the real world computers deal with millions or billions of data items. So the problem is that people try out their new ideas with a very small data set, and don't realise just how bad it gets with a larger data set.
I am guessing that you haven't yet done the course on Algorithms & Data Structures? In that course you will learn that a bad algorithm can take billions of years to do something, but a good one can do the same job in less than 1 second. An example is Euler Project problem 67, and that has a small amount of data (A tree with a depth of only 100 )
So my advice is to learn more about the good sorting algorithms that are out there, like quicksort for example. In my mind this is way better than starting with a bad algorithm and trying to "fix it up".