BubbleSort question

Jun 6, 2013 at 1:33pm
Hi there,

I have an assignment to do with BubbleSort. This particular section of the assignment asks me to create a doBubbleSort method in my ArraySorter class. The method body should call another function(function will swap array elements if less than the next element) 'n' amount of times, where n is the size of our array. If I need to do something 'n' amount of times, what C++ feature do I use?

Thank you in advance for any help! It is greatly appreciated!

flyingEagle
Jun 6, 2013 at 1:39pm
check out the for, while, do loops
Jun 6, 2013 at 4:20pm
A loop. A for loop would be recommended as you know exactly how many times you want to iterate.
Topic archived. No new replies allowed.