assumptions about the input

assumptions about the input

hello,
I'm Roi from Israel.
Can i do any assumptions regarding the array size?
thanks and goodluck all.

8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Shalom Roi,

No you can't make any assumption.
We won't feed a 500Go file as a test file, but we'll clearly try different files in nature, size, number, ... so the flexibility of your solution is important.

Regards, Paul Guermonprez
Intel Software Academic Program Manager, EMEA

Hi Paul,Question 1: Can you guarantee that the input files will be well formatted? Like not having any empty lines or more numbers on a line than on a different one?Question 2: Do you guarantee that each of the input files sizes are lower than the amount of RAM the environment has? Because this would certainly create a different problem.Thanks

hello

yes the input is well formatted.
yes each input file is smaller than total available memory.

regards paul

Can we assume file will have positive and negative numbers?Or algorithm should work for all negative matrix too?Thanks,Marijan

Marijan Juresic

Hi Marijan,

is there any reason why the algorithm shouldn't work with all-negative values?

No but if you are counting a positive sum, you have to work around the fact that all values can be negative, maiking the best subarray the greater negative number.

I asked, because just wanted to be sure, not to waste time on implementing algorithm work for this case too :) In my case it's a little bit more expensive to include all negative matrixes. But every millisecond is worth fighting for :)

Marijan Juresic

Leave a Comment

Please sign in to add a comment. Not a member? Join today