-
Reading from file
Hi,
I am new to java and wish to implement a program, that will read numbers from a text file, put them into an array so that I can then perform an Insertion sort on them.
I have managed to get an insertion sort working so far, with a fixed array, but can not do it reading an array from file,
any help would be appreciated.
Thanks
Gower
-
Re: Reading from file
We can't help you without seeing your code.
-
Re: Reading from file
Your sort code should work the same no matter where you get the data to be sorted from.
What code are you using to read the data with?
The Scanner class has some easy to use methods.
Or do a Search on the Forum for readLine() to get sample code for using the BufferedReader class.