Using Figure 7.1 in CLRS as a model, illustrate the operation of Partition on the array A = (9, 5, 2, 6, 3, 4).
(a)
p, i, j = 2, 8, 7
(b)
(c)
2, 7, 3, 5, 6, 4, 9
(d)
(e)
2, 7, 3, 5, 6, 4, 9
(f)
2, 4, 3, 5, 6, 7, 9
(g)
2, 4, 3, 5, 6, 7, 9
(h)
2, 4, 3, 5, 6, 7, 9
(i)
2, 4, 3, 5, 6, 7, 9