the secondary max element in array O(n+lgn) cmp