MCQOPTIONS
Saved Bookmarks
| 1. |
What is the formula to be used to calculate the total number of comparisons in bubble sort with n elements after k iterations? |
| A. | (4k*k - k)/2 |
| B. | (2kn - k*k +k)/2 |
| C. | (2kn - k*k - k)/2 |
| D. | (2kn + k*k +k)/2 |
| Answer» A. (4k*k - k)/2 | |