Till KTH:s startsida Till KTH:s startsida

Lab Assignments

All the labs are mandatory. ​

Demonstrations

  • It is encouraged to make groups of two students for your demonstrations.
  • Regarding the time slot to demonstrate your labs, please follow the instructions from the TA team given at the beginning/during the lab hour. ​

Bonus points

  • You can get a maximum of five bonus points if you demonstrate your labs and pass the demonstrations no later than the deadline - the end of each lab session.
  • Demonstrations can be done after deadline but no bonus point can be given.

Lab 1  [bonus deadline 2016-11-10] 

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-17] 

Second Lab

Lab 3  [bonus deadline 2016-11-24] 

Third Lab

Lab 4  [bonus deadline 2016-12-01] 

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] 

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

Atsuto Maki skapade sidan 19 oktober 2016

Lärare kommenterade 15 december 2016

As mentioned above, lab demonstrations can be done after deadlines (without bonus point) but all the five need to be completed. You then need find a time slot from one of the TAs - recommended within 3 weeks after the exam (although there's no official deadline this year).