2 Five different integers are to be sorted into ascending order.
- A bubble sort is to be used on the list of numbers \(\quad 6 \quad 4 \quad 5 \quad x \quad 2 \quad 11\).
- After the first pass, the list of numbers becomes
$$\begin{array} { l l l l l }
4 & x & 2 & 6 & 11
\end{array}$$
Write down an inequality that \(x\) must satisfy.
- After the second pass, the list becomes
$$\begin{array} { l l l l l }
x & 2 & 4 & 6 & 11
\end{array}$$
Write down a new inequality that \(x\) must satisfy.
- The five integers are now written in a different order. A shuttle sort is to be used on the list of numbers \(\quad \begin{array} { l l l l l } 11 & x & 2 & 4 & 6 . \end{array}\)
- After the first pass, the list of numbers becomes
$$\begin{array} { l l l l l }
x & 11 & 2 & 4 & 6
\end{array}$$
Write down an inequality that \(x\) must satisfy.
- After the second pass, the list becomes
$$\begin{array} { l l l l l }
2 & x & 11 & 4 & 6
\end{array}$$
Write down a further inequality that \(x\) must satisfy.
- Use your answers from parts (a) and (b) to write down the value of \(x\).