C++ Lab: Bubble Sort - 43169

Request Posted by
mrbranch206

mrbranch206

Rating : No Rating
Earned: $0
Request Detail
Price: $15
  • From: Computer Science, Programming
  • Due on: Wed 12 Feb, 2014 (10:25am)
  • Asked on: Wed 12 Feb, 2014
  • Due date has passed, but you can still Post Solution.
Description
  • Create a class called “BubbleStorage”.

?                     Internally use a “vector” from the STL to store the data.

?                     Write a method that will add data to the vector.

?                     Write a method that will display the in the array (use an iterator to access each element)

  • Write a Max method that will sort the internal vector by using a "Bubble Sort" algorithm and sort with largest value first .
  • Write a Min method that will sort the internal array using a Bubble sort with the smallest value first.

 

  • In the “main” of your program         

?                     Call rand() to get a number between 25 and 75

?                     Add that many numbers to the BubbleStorage class

?                     Print out the array that is stored by overloading the "<<" operator for your class. (Your code should be Example: cout << bublesort << endl;)

?                     Print out the array both max sorted and min sorted.

Note:  How much easier it is to use a Vector.   Notice that you did not need to know the size of the array before using or declaring it.

 

Attachments
Lab 2.docx
Lab 2.docx
3 Solution for C++ Lab: Bubble Sort
Title Price Category solution By purchased  
C++ Lab: Bubble Sort
$15.00 no category sarmad_junaid 0 time(s)
C++ Lab: Bubble Sort
$10.00 no category lightsource 2 time(s)
Advance payment
$10.00 no category sarmad_junaid 1 time(s)
Please Login or Register to Submit the Solution for the Request