문제
Quicksort is a recursive sorting algorithm developed in 1959 by Tony Hoare. One of the major steps in the algorithm is the partition\/ step: given an element in the array (the pivot\/ element) rearrange the elements in the array as shown below where all the values in are and all elements in are .
Figure A.1 below shows an array before and after it's been partitioned with the pivot element . Note that the elements in and are typically not in sorted order and either one of them could be empty.
Figure A.1: An array before and after a partition
How a partition is executed and how a pivot element is selected are fascinating questions but are not of interest to us. What we would like you to do is the following: given an array, determine all the values that could be the pivot value assuming the array has been partitioned, or determine that the array has not been partitioned.