// 11/20/2019 /** this class checks for duplicate values in an array */ public class Duplicates { public static void main(String[] args) { int[] numbers = {99, 97, 96, 99, 98, 97, 96}; duplicateSearch(numbers); int[] newNums = {1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 4}; duplicateSearch1(newNums); // print tble of *'s for (int i=0; i<5; i++) { // outer loop loops for each row System.out.print(i + " "); for (int j=i; j<5; j++) { // inner loop loops on row i to print *'s System.out.print("*"); } // finished all *'s on row i System.out.println(); } } /** check for duplicates in a SORTED array * @param arr is the array to search @return true if duplicate is found */ public static boolean duplicateSearch1(int[] arr) { boolean found = false; for (int i=0; i