4 Array

1 is the linear one-dimensional array table, can be defined as a two-dimensional array "is a data element which is a one-dimensional array" linear form.

1.1 Find Most elements: Suppose there is a majority of elements in the array, the array to identify more than 50% of the elements.

Algorithm idea : each find two different element, it is deleted in pairs, ie count--, the final remaining necessarily asked for.

1.2 the minimum number of array arranged

Enter a positive integer array, the array of all the numbers arranged in a number spliced ​​together, the splice can print out all numbers smallest one. 3,32,321 input array} {e.g., print the minimum number of three numbers can be arranged to 321,323.

Guess you like

Origin www.cnblogs.com/sketeton/p/11688834.html