title: What kind of data type should I use if I have to implement Binary Search on a large amount of data?
body: <p>Edit: Okay my question has been answered. Thank you. Initially I had doubts about using an array of 1 million cause I read it caused some problems in C, so thanks for your responses everyone!</p>
  
  <p>Okay hi guys, I have a school assignment where I have to code a binary search to search for a piece of data in a set of data that may be up to 1 million in size.</p>
  
  <p>I'm planning to just stick to numbers so the binary searching itself should be pretty easy. The data will simply be tons of randomly generated numbers (sorted) onto a text file and I plan to get the program to open the file and load all the data onto the array.</p>
  
  <p>However up to now I've simply been using array sizes of up to several hundred. <strong>So here's my question: Would it be practical to declare an array of 1 million?</strong></p>
  
  <p>If it's not practical to have an array size of 1 million then what would you guys suggest? Do I have to split up the data into multiple files and have a smaller array size of say, 10,000? Or is there another data type besides arrays that I could use?</p>
  
  <p>Would greatly appreciate any helpful responses, thanks!</p>
  
  <p>PS: I'm coding in Java.</p>