[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/atwill007/cpp-algorithms/master/sorting/BubbleSort.cpp [Back]  [Original]

#include 
#include                // 
#include             // ostream_iterator
#include "./lib/DoubleVector.h" // Double
using namespace std;

/**
 * 
 */

int main()
{
  vector vList = cinDoubleVector();
  int len = vList.size();

  // 
  for (int i = 0; i < len; i++)
  {
    for (int j = 0; j < len - 1 - i; j++)
    {
      if (vList[j] > vList[j + 1])
        swap(vList[j], vList[j + 1]);
    }
  }

  coutDoubleVector(vList);

  return 0;
}

Web Proxy Viewer  |  New URL  |  Original Page