Assignment 1

Last update to this post: 01.12.2015 (extra sample tests for FileDiff)

The first assignment has been published here.

You are now able to upload the archive with your solution, for automatic judging on vmchecker. You can log in on it using your moodle accounts.

If you choose to implement in Java, the archive must contain:

  • FileDiff.java
  • Tunnel.java
  • Readme

Important! The java files must not have any package declaration in it. If it has, then remove it before uploading the archive. Otherwise, only if you want to use a different structure, you will need to provide a Makefile.

If you implement in C/C++, you need to provide a Makefile with at least these 3 rules:

  • build     – a rule to build the binary files
  • run-p1  – a rule that runs the binary for the first problem
  • run-p2  – a rule that runs the binary for the second problem

Makefile examples:

Sample tests for the two problems: sample_tests (these are some of the tests actually used for evaluating your solution)

Remember to describe in the Readme file the algorithm used in your solution, and its complexity.

Coding style suggestions.

The deadline for the assignment is 01.12.2015 23:59.

Any questions can be addressed as comments on this post.

Answered Questions:

Q1 (FileDiff): Two lines are considered equal if they contain the same ASCII alphabet characters, in the same order.

For example, the line “To be or not to be” is considered the same as “To be, or, not  to be” but different from “Not to be or to be”

Q2 (FileDiff): A file may contain any number of duplicate lines.

Update:  A set of small sample tests for the FileDiff problem, that are easier to debug but require that you implement the minimum lexicographically condition correctly:  File Diff extra sample tests

9 Responses to Assignment 1

  1. Constantin says:

    Hello!

    At Problem 1 (FileDiff) it is specified that each file has at maximum 1300 lines. I have seen that both FileDiff_10_1.in and FileDiff_10_2.in have more than 1300, more precisely, 1317.

    Is there a mistake or am I missing something?

    Thanks 🙂

    • raduiacob says:

      Yes, you are right, the maximum number of lines in one file actually reaches 1317 for that particular test. No other test exceeds that value. 🙂
      I have updated the value in the assignment document.
      Thanks!

  2. tudalex says:

    All the input and output file paths are relative to the location where the homework is run. So in order to open the file tunnel.in in java you just have to do new File(“tunnel.in”).
    You don’t have to specify any absolute path.

  3. Constantin says:

    The phrase : “Jones needs to go through every section consecutively in order to reach the exit.” means that Jones has to go exactly on the path 0,1,2…,n-1 (turning back allowed) or that he has to go from one section to another, going through one time only through every switch (e.g. 0, 1, 4…)?
    Thanks!

  4. Victor says:

    Hello!

    Are we now allow to use Java8 Api ? The vmcheker seems to have problems with lambda expression syntax.

  5. Nick says:

    I tried uploading the first problem in order to see home I scored (haven’t finished the second but vmchecker keeps on giving errors saying that my makefile is wrong or has no rule. I’ve made the makefile properly, i took it from git hub also the zip file that i uploaded contains the makefile,the filediff.cpp and tunnel.cpp.

    • raduiacob says:

      The evaluation script assumes the source files and the makefile are at the top level of the archive. Your current archive contains them inside another folder. If you move them one level up it should compile without issue.

Leave a comment