Extend the program above
by using the methods from Quick
to find the three smallest by width
and the three largest by area.
Print out the whole List
one element per line
after each operation.
Do not sort the whole array.
For example,
your output might be:
Original List
- 4.7x5.6 Rectangle
- 9.4x9.2 Rectangle
- 5.4x4.3 Rectangle
- 3.1x5.2 Rectangle
- 5.0x1.4 Rectangle
- 3.4x5.8 Rectangle
- 1.6x7.7 Rectangle
- 7.6x2.8 Rectangle
- 2.5x3.9 Rectangle
- 7.3x6.6 Rectangle
With three narrowest at front:
- 1.6x7.7 Rectangle
- 2.5x3.9 Rectangle
- 3.1x5.2 Rectangle
- 3.4x5.8 Rectangle
- 4.7x5.6 Rectangle
- 5.4x4.3 Rectangle
- 9.4x9.2 Rectangle
- 7.6x2.8 Rectangle
- 7.3x6.6 Rectangle
- 5.0x1.4 Rectangle
With three largest areas at end:
- 5.0x1.4 Rectangle
- 2.5x3.9 Rectangle
- 1.6x7.7 Rectangle
- 3.1x5.2 Rectangle
- 3.4x5.8 Rectangle
- 7.6x2.8 Rectangle
- 5.4x4.3 Rectangle
- 4.7x5.6 Rectangle
- 7.3x6.6 Rectangle
- 9.4x9.2 Rectangle