public class SecondMax {
public static void main(String[] args) {
SecondMax count = new SecondMax();
Integer[] arr = {
10, -2, 33, 140, 25, 33, -2, 0, 140};
//1. Use sorting, output is :
//The second max element is 33
count.
算法 - 找出数组中第二大的元素(java)
最新推荐文章于 2024-05-05 01:16:29 发布