# Question 4 (Module Outcome #4): Find the best-case, worst-case and average-case number of < comparisons are performed by the following piece of pseudo

Question 4 (Module Outcome #4): Find the best-case, worst-case and average-case number of < comparisons are performed by the following piece of pseudocode. Precondition: $$n\in\{1,3,5,7,9\}\ \text{while}\ n < 6\ \text{do}\ n\leftarrow n+3$$

• Questions are typically answered in as fast as 30 minutes

### Plainmath recommends

• Get a detailed answer even on the hardest topics.
• Ask an expert for a step-by-step guidance to learn to do it yourself.

Laith Petty
Base-case: 1 comparison
Average-case: 1.8 comparisons
Worst-case: 3 comparisons