My own quicksort algorithm I will make it more reader friendly after I get the algorithm completed. Does anything with the quick sort algorithm stand out as for why it is not working 100%? This is not homework; I am just practicing problems out of books and I am caught on this one.

Hints, more so than answers, would be more appreciated. Please don't post your own quick sort algorithm, as copying someone else's code does not help me learn. I am just looking for that last bit to help me make the leap across; I don't want you to build another bridge somewhere else, and say "use mine"; it won't help. If my algorithm is a lost cause just say so, and I will go back to the drawing board.

#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;algorithm&gt;
#include &lt;iterator&gt;
#include &lt;cmath&gt;
#include &lt;ctime&gt;
#include &lt;assert.h&gt;

using std::vector;
using std::cin;
using std::cout;
using std::endl;
using std::vector;
using std::ostream_iterator;
using std::istream_iterator;

void print_part( vector&lt;float&gt;::iterator l,
                 vector&lt;float&gt;::iterator r ) {
    copy( l,r+1,ostream_iterator&lt;float&gt;( cout," " ) );
    cout &lt;&lt; endl;
}

void print( std::vector&lt;float&gt; &amp;data ) {
    copy( data.begin( ), data.end( ), 
          ostream_iterator&lt;float&gt;( cout," " ) );
    cout &lt;&lt; endl;
}

void swap( vector&lt;float&gt;::iterator left,
           vector&lt;float&gt;::iterator right ) {
    cout &lt;&lt; "Swaping " &lt;&lt; (*left) &lt;&lt; " with " &lt;&lt; (*right) &lt;&lt; endl;
    float tmp = (*right);
    (*right) = (*left);
    (*left) = tmp;
}

int get_pivot_index( vector&lt;float&gt; &amp;data,
                     vector&lt;float&gt;::iterator left,
                     vector&lt;float&gt;::iterator right ) {
    int pivot_index = ((right-left)/2);
    int base = std::distance( data.begin( ),left );
    return ( pivot_index+=base );

}

void my_qsort( vector&lt;float&gt; &amp;data, 
               vector&lt;float&gt;::iterator left,
               vector&lt;float&gt;::iterator right,
               int side
             ) {
     ((side==0) ? cout&lt;&lt;"":(side==1) ? cout&lt;&lt;"Left: " : cout&lt;&lt;"Right: " );
     print_part( left,right );
     if( (right-left)&gt;0) {
         vector&lt;float&gt;::iterator lit=left;
         vector&lt;float&gt;::iterator rit=right;
         int pivot_index = get_pivot_index( data,left,right );
         int pivot=data[pivot_index];
         cout &lt;&lt; "pivot = " &lt;&lt; pivot &lt;&lt; endl;
         while( lit &lt;= right &amp;&amp; rit &gt; left &amp;&amp; lit &lt;= rit ) { 
             while( lit &lt;= right &amp;&amp; (*lit) &lt; pivot ) {
                 if( lit &gt; rit ) { break; }
                 else { lit++; }
             }
             while( rit &gt; left &amp;&amp; (*rit) &gt;= pivot ) { 
                 if( lit &gt; rit ) { break; }
                 else { rit--; }
            }
            if( lit &lt; rit ) { swap( lit,rit ); }
        }
        my_qsort( data,left,rit,1 );
        my_qsort( data,lit+1,right,2 );
    }
    char c;
    cin &gt;&gt; c;
}

int main( int argc, char *argv[ ] ) {
    vector&lt;float&gt; 
    data( 
          ( istream_iterator&lt;float&gt;( cin ) ),
          ( istream_iterator&lt;float&gt;( ) )
        );
    cout &lt;&lt; "-----------------------------------------------" &lt;&lt; endl;
    my_qsort( data,data.begin( ),data.end( )-1,0 );
    cout &lt;&lt; "-----------------------------------------------" &lt;&lt; endl;
    print( data );
    return ( 0 );
}
The last three libraries should be removed as they're not being used.  There's no need to keep a library around if you're long longer using it or have never used even it.

You may also consider organizing them in some way, such as alphabetically.
You don't really need these:


using std::vector;
using std::cin;
using std::cout;
using std::endl;
using std::vector;
using std::ostream_iterator;
using std::istream_iterator;



Just use std:: where needed, otherwise it'll just get longer if you add more.  Also, you have listed using std::vector twice, but it should just be there once.
print() isn't modifying any data members (it just prints something):


print( std::vector&lt;float&gt; &amp;data )



so data should be passed by const&amp; to avoid an unnecessary copy:

print(std::vector&lt;float&gt; const&amp; data)

There's no need to provide your own swap() function; just use std::swap:

std::swap(lit, rit);

This is not a very common nor maintainable style in my_qsort():


if( lit &gt; rit ) { break; }
else { lit++; }



Put each bracketed statement on its own line, in case you ever need to add to them:

if (lit &gt; rit) {
    break;
}
else {
    lit++;
}

Why is there a "pause" in my_qsort()?


char c;
cin &gt;&gt; c;



Just let the function works without such interruptions.  But if you must keep it anyway, then at least make the user aware that it's a pause, and tell them to input a character in order to continue.
Using parentheses for a simple return is not really needed:


return ( 0 );



Just keep it simple and omit them:

return 0;


Moreover, you don't really need this.  Reaching the end of main() already implies success, so the compiler will insert the return itself.