Categories
Learn and make

C vs. C++: Bubble sort

I have identical bubble sort algorithm in C and C++. Same data and same computer. Experiment shows that C is twice as slow as C ++. In C it takes 124 processor clicks or 0.000124 sec. In C++ it takes 66 processor clicks or 0.000066 sec. C Bubble sort code: C++ Bubble sort code: https://github.com/taunoe/cpp-examples/tree/master/Sorting-algorithms/Bubble-sort