Bubble sort algorithm implementation in Cpp