Data Structures, Algorithms, Java, Big O Notation, Searching And Sorting.
Integer>(); // Traverse through the given array for (int i = 0; i < arr.length; i++) { // Get if the element is present Integer c = hmap.get(arr[i]); // If this is first occurrence of element // Insert the element if (hmap.get(arr[i]) == null) { hmap.put(arr[i], 1); } // If elements already exists