title: Java HashMap<Integer, Integer> vs int[]
body: <p>I have an integer array of size 10000, which is gradually filled with other integers (context: <a href="http://uva.onlinejudge.org/external/1/100.pdf" rel="nofollow">http://uva.onlinejudge.org/external/1/100.pdf</a>), but it is not large enough. I plan to replace it with a HashMap, and was wondering if this was a better idea than making the array arbitrarily larger (eg. increasing the size to 100000)?</p>
  
  <p>Also, what are the main differences between a HashMap and an integer array?</p>
  
  <p>N.B. In this case, only odd keys are used in the HashMap/array.</p>