Till KTH:s startsida Till KTH:s startsida

Exercises

Some exercises that could be challenging to do, some are easy and some harder. I'll add more of these as I have time.

General recursion

These exercises use general recursion and is an introduction to functional programming. The first is something that you should have done by the first week. The second is a very good exercise to do before we start on the meta interpreter. The third will show you how recursive thinking can solve quite complex problems.

Operations on a tree

The exercises show how you can implement an advanced tree data structure and its operations using pattern matching. If you not yet comfortable with working with pattern matching these exercises are quite challenging. If you have learned how to think in patterns they are a fun exercise that will show you how powerful pattern matching is. As an added bonus you will learn some fun algorithms. 

Concurrency

The first exercise is something that you should do as soon as we start with concurrency. The second exercise introduce concepts as locks, semaphores and monitors. In an actors based language you normally do not think in terms of locks etc but it is important to understand what these concepts are. The third exercise is only if you want to have a challenging project. 

Lärare Johan Montelius skapade sidan 19 januari 2016

Johan Montelius redigerade 19 januari 2016

Some exercises that could be challenging to do, some are easy and some harder. I'll add more of these as I have time.


* introduction.pdf
* derivative.pdf
* trains.pdf

Johan Montelius redigerade 2 februari 2016

Some exercises that could be challenging to do, some are easy and some harder. I'll add more of these as I have time.


* introduction.pdf
* derivative.pdf
* trains.pdf
* twothree.pdf

kommenterade 25 februari 2016

Angående Trains och Move Compression: Om man följer algoritmen från avsnitt 4, hur kan man komma i ett läge där man först får steget {one, 1} direkt följt av {one, -1} ?

Enda sättet jag kan se att man får två one efter varandra är innan optimeringen till few men med few förstår jag inte hur man skulle få två växlingar till samma spår i följd.

Johan Montelius redigerade 16 februari 2018

Some exercises that could be challenging to do, some are easy and some harder. I'll add more of these as I have time.


* introduction.pdf
* derivative.pdf
* concurrency.pdf
* mutex.pdf
* trains.pdf
* twothree.pdf
* splay.pdf
* avl.pdf

Johan Montelius redigerade 3 februari 2019

Some exercises that could be challenging to do, some are easy and some harder. I'll add more of these as I have time.


* introduction.pdf
* derivative.pdf
* concurrency.pdf
* mutex.pdf
* trains.pdf
* twothree.pdf
* splay.pdf
* avl
General recursion These exercises use general recursion and is an introduction to functional programming. The first is something that you should have done by the first week. The second is a very good exercise to do before we start on the meta interpreter. The third will show you how recursive thinking can solve quite complex problems.¶


* introduction.pdf
* derivative.pdf
* trains.pdf
Operations on a tree The exercises show how you can implement an advanced tree data structure and its operations using pattern matching. If you not yet comfortable with working with pattern matching these exercises are quite challenging. If you have learned how to think in patterns they are a fun exercise that will show you how powerful pattern matching is. As an added bonus you will learn some fun algorithms. ¶


* twothree.pdf
* splay.pdf
* avl.pdf
Concurrency The first exercise is something that you should do as soon as we start with concurrency. The second exercise introduce concepts as locks, semaphores and monitors. In an actors based language you normally do not think in terms of locks etc but it is important to understand what these concepts are. The third exercise is only if you want to have a challenging project. ¶


* concurrency.pdf
* mutex
.pdf
* bitonic.pdf