It would help if you could tell us the problem with your code.

- First of all, isnt there any problem with declaring "int dataset[] = new int[ datasetSize ]; " before declaring "datasetSize"?

-...