answersLogoWhite

0

Best case: 2

Worst case: 3

Average: 2+2/3

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

How many credits are needed for a 3 year college program?

On average I think it is 12 credits needed for a 3 year college.


What is the difference between insertion sort and selection sort?

Both bubble sort and selection sort are in-place sorts, which means they require no additional space to sort. Both are O(n). Both also share worst/average case time complexities of O(n2). Selection sort also has O(n2) for a best case scenario, while an intelligent bubble sort implementation will have O(n) for a best case (already sorted) scenario. Note that while looking at the numbers above seem to show that bubble sort has a slight edge over selection sort, in practice you should choose selection over bubble. It will very nearly always perform better in real-time tests.


How do i find the average of 42?

Two or more numbers are needed to find the average then you add them up then divide them by how many there are as for example the average of 2+4+6 = 12 and so 12/3 = 4 which is the mean average


What is the average height and weight of a Homo habilis?

Homo habilis is estimated to have had an average height of around 4 feet 3 inches (130 cm) and an average weight of about 77 pounds (35 kg). These estimates are based on fossil evidence and comparisons with modern human relatives.


What is the formula if you have the average of 3 numbers equaling 78 you need to find the 4th number to get an average of 80?

To find the 4th number needed to achieve an average of 80, first calculate the total sum of the current 3 numbers, which is (3 \times 78 = 234). For an average of 80 with 4 numbers, the total sum must be (4 \times 80 = 320). Therefore, the 4th number can be found by subtracting the sum of the first 3 numbers from the desired total: (320 - 234 = 86). Thus, the 4th number needed is 86.


How long is on average is cheddar cheese aged for?

A minimum of 3 months is needed but can be up to 30 months. The longer it is aged the "sharper" it becomes.


What is the Average breathing rate of tropical fish per minute?

it is sort of different for all fishes .for example a sperm whale breaths 3-4 times per minute


What is an average number of iterations to sort 3 elements?

If you're only sorting 3 elements, it should take you 0 to 2 iterations. Of course, this answer might change if you're trying test out a scalable sorting algorithm.


How do you program c plus plus to arrange 3 numbers in ascending order using swap?

void sort (int& a, int& b, int& c) { if (a>b) std::swap (a, b); if (b>c) std::swap (b, c); else return; if (a>b) std::swap (a, b); } Note that this is based upon a bubble sort algorithm. Although usually inefficient as a general sorting algorithm, given that we know there are only three elements means we can implement it reasonably efficiently without any additional space complexity. There will always be 2 or 3 comparisons but at most there will be 3 swaps. The only improvement we could really make is to implement a type of selection sort: void sort (int& a, int& b, int& c) { if (a>b && a>c) std::swap (a, c); else if (b>c) std::swap (b, c); if (a>b) std::swap (a, b); } Here we either make 3 or 4 comparisons but only 2 swaps at most. The assumption here is that a comparison is a quicker operation than a swap thus the selection sort method is more efficient. However, unless you were to sort millions of sets of three one after the other, you are unlikely to see any measurable difference in performance.


Comparison of adjectives?

Comparisons of Adjective: 1.Positive 2Comparative 3.Superlative


How may beta coefficients be used to standardize returns for risk to permit comparisons of mutual fund performance?

3


How may beta coefficients be used to standardize the returns for risk to permit comparisons of mutual fund performance?

3