Visa version
Visa
< föregående
|
nästa >
Jämför
< föregående
|
nästa >
Lab Assignments
Bonus points
You can get a maximum of five bonus points if you demonstrate your labs and pass the demonstrations no later than the day of the deadline. Demonstrations can be done after deadline but no bonus point can be given.
Lab 1 [bonus deadline 2016-11-11]
You don't need to use strings as stacks in this lab, you can use the cell array implementation or any other.
First Lab
First Exercise Set
The code for stacks:
Pop
Push
Init
IsEmpty
Trial program
Lab 2 [bonus deadline 2016-11-19] (to be finalised)
Lab 3 [bonus deadline 2016-11-25] (tentative)
Lab 4 [bonus deadline 2016-12-02] (tentative)
This assignment prepares you for the final assignment (5th lab).
You should be able to finish this earlier than the deadline. The workload on assignment lab 5 is somewhat more than the others!
Fourth Lab
adt.c
Lab 5 [bonus deadline 2016-12-15] (tentative)
The workload on this assignment is somewhat more than the others.
Fifth Lab
The structure definition given in the lab is to store vectors with whole number entries, you can change the type of the field "data" to store real numbers instead.
Template for Sparse Vector Program :
sparse.c
The template program includes a function for printing vectors which you can use in your final version. It also includes a function for reading in entries from standard input (check out the comments in the code). This latter function is for you to try other functions out without implementing the part about reading the vector database.
Here is a simple program that reads integers from a file, along with explanatory comments:
readfile.c
Adjust if necessary!
Here is a test file for lab 5: test.txt
Some test cases for the program are as follows:
> temp = v11 - v7 temp is -8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 > temp . v12 -16 > temp = v3 + v4 temp is 5 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > temp + v5 5 0 0 5 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
The general tutor
It is available on the 4'th floor in the E building monday - friday 11 a.m. to 1 p.m. and 5 p.m. to 8 p.m.
For more information look at the homepage:
http://www.kth.se/en/csc/student/2.40186/general/tutor-1.284250