matthias152 / algorithms

0 stars 0 forks source link

Implement reading and writing to file. #12

Closed DamianJaskolski95 closed 2 years ago

DamianJaskolski95 commented 2 years ago
  1. Implement function to read data from file. File should have name, format doesnt matter (could be txt) First line should be number of elements. Second line should be values divided by ','. Third file should be weights divided by ','. Should look like this:

    4 1,2,3,4 5,6,7,8

  2. Implement function to write data to file. It should create or append to a file with same order as in point 1. Add separator in the first line, so the above structure goes from next line. Next line should be max weight used in program. Next line should be algorithm used. Next line should be result of function. Should look like this:
    This is new attempt

    4 1,2,3,4 5,6,7,8 5 greedy 13