for more vivid display of the partitioning processset the partition workshop applet to bars and press the run button the leftscan and rightscan pointers will zip toward each otherswapping bars as they go when they meetthe partition is complete you can choose any value you want for the pivot valuedepending on why you're doing the partition (such as choosing grade point average of for varietythe workshop applet chooses random number for the pivot value (the horizontal black lineeach time new or size is pressedbut the value is never too far from the average bar height after being partitionedthe data is by no means sortedit has simply been divided into two groups howeverit' more sorted than it was before as we'll see in the next sectionit doesn' take much more trouble to sort it completely notice that partitioning is not stable that iseach group is not in the same order it was originally in factpartitioning tends to reverse the order of some of the data in each group the partition java program how is the partitioning process carried outlet' look at some example code listing shows the partition java programwhich includes the partitionit(method for partitioning an array listing the partition java program /partition java /demonstrates partitioning an array /to run this programc>java partitionapp ///////////////////////////////////////////////////////////////class arraypar private long[thearray/ref to array thearray private int nelems/number of data items //public arraypar(int max/constructor thearray new long[max]/create the array nelems /no items yet //public void insert(long value/put element into array thearray[nelemsvalue/insert it