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!
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.
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.
However up to now I've simply been using array sizes of up to several hundred. So here's my question: Would it be practical to declare an array of 1 million?
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?
Would greatly appreciate any helpful responses, thanks!
PS: I'm coding in Java.