String Processing Algorithms

Algorithms and machine learning
Advanced studies
Basic algorithms and data structures for string processing: exact and approximate string matching, string sorting, dictionary data structures, text indexing.


12.12.2013 16.00 B123
Year Semester Date Period Language In charge
2013 autumn 29.10-05.12. 2-2 English Juha Kärkkäinen


Time Room Lecturer Date
Tue 12-14 B222 Juha Kärkkäinen 29.10.2013-05.12.2013
Thu 12-14 B222 Juha Kärkkäinen 29.10.2013-05.12.2013

Exercise groups

Group: 1
Time Room Instructor Date Observe
Tue 14-16 B222 Dominik Kempa 28.10.2013—06.12.2013

Registration for this course starts on Tuesday 8th of October at 9.00.



Course Exam 12.12.2014

Renewal/Separate Exam 07.02.2014


NEWS: Guest speaker on the lecture on Tuesday 19.11. at 13:15 in B222: Prof. Maxime Crochemore (King's College London): Tracking down repeats in strings.

The course introduces basic algorithms and data structures for string processing including: exact and approximate string matching, string sorting, dictionary data structures and text indexing.

Together with Project in String Processing Algorithms (Period III) this course is one of the three elective course pairs in the subprogram of Algorithms and Machine Learning.

The course is also useful for students in the Master's degree program for Bioinformatics, particularly for those interested in biological sequence analysis.

The students are expected to have basic knowledge on algorithms, data structures, finite automata and algorithm analysis. Recommened prequisite course are Data Structures, Models of Computation, and Design and Analysis of Algorithms.

Completing the course

The course consists of lectures, exercises and an exam.

Lectures: Tue and Thu 12-14 in B222.

Attending lectures is not obligatory but it is useful. Lecture notes covering key facts will be posted on this page, but there will be additional examples and explanations during the lectures.

Exercises: Tue 14-16 in B222.  (NOTE: First exercise session is already on the first week, 29.10. The problems are already available.)

Exercise problems will be available on this page about a week before each exercise session. Model solutions will be available after the exercise session.
The students should solve the problems at home and be prepared to present their solutions at the exercise session. The students are not required to solve all problems, but additional points are awarded according to how many problems have been solved:

  • 20% marked problems is required and gives 1 point.
  • 80% marked problems gives the maximum of 10 points.

Exam: Thu 12.12. at 16:00. (Preliminary, please check the time and place a few days before the exam.)

The course exam consists of problems similar to those in the exercises. No notes or other material is allowed in the exam.

Passing the course or raising the grade is possible later at a renewal exam (where the exercise points affect the grade as with the course exam) and at separate exams (where exercise points are ignored).

See last year's course for examples of exam problems.


The grading is based on the points from the exercises (max. 10 points) and the exam (max. 50 points).

  • 30 points is required to pass and gives the lowest grade 1.
  • 50 points gives the highest grade 5.

Literature and material

All essential material can be found in the lecture notes and in the exercise problems and solutions that will be posted here during the course.

The course will be similar (but not necessarily identical) to last year's course.

Lecture notes

  1. Lecture 29.10. (pages 1-18) PDF | PDF (8 slides/page) Errata: Errors in Fibonacci strings F5-F8 and the De Bruijn graph example have been corrected.
  2. Lecture 31.10. (pages 19-38) PDF | PDF (8 slides/page) Change: Notations for sum of set lcp values have changed, see Definitions 1.6 and 1.7 (pages 20-21).
  3. Lecture 05.11. (pages 39-60) PDF | PDF (8 slides/page)
  4. Lecture 07.11. (pages 61-80) PDF | PDF (8 slides/page)
  5. Lecture 12.11. (pages 81-94) PDF | PDF (8 slides/page) Change: Pages 93-94 moved to next lecture with small additional comment at the end.
  6. Lecture 14.11. (pages 93-108) PDF | PDF (8 slides/page)
  7. Lecture 19.11. (pages 109-119) PDF | PDF (8 slides/page) Guest speaker at 13:15: Prof. Maxime Crochemore (King's College London): Tracking down repeats in strings.
  8. Lecture 21.11. (pages 120-144) PDF | PDF (8 slides/page)
  9. Lecture 26.11. (pages 145-167) PDF | PDF (8 slides/page)
  10. Lecture 28.11. (pages 168-180) PDF | PDF (8 slides/page)
  11. Lecture 03.12. (pages 181-201) PDF | PDF (8 slides/page)
  12. Lecture 05.12. (pages 202-220) PDF | PDF (8 slides/page)

Exercise problems and solutions

  1. Exercises 29.10.: Problems
  2. Exercises 05.11.: Problems
  3. Exercises 12.11.: Problems
  4. Exercises 19.11.: Problems
  5. Exercises 26.11.: Problems
  6. Exercises 03.12.: Problems

Practice exercises: Problems


The course does not follow any book. The books and articles below can be useful supplementary material but are not required reading.

  • M. Crochemore, C. Hancart and T. Lecroq. Algorithms on Strings. Cambridge University Press, 2007.
  • M. Crochemore and W. Rytter. Jewels of Stringology. World Scientific Publishing, 2002.
  • D. Gusfield. Algorithms on Strings, Trees and Sequences: Computer Science and Computational Biology. Cambridge University Press, 1997.
  • E. Ohlebusch. Bioinformatics Algorithms: Sequence Analysis, Genome Rearrangements, and Phylogenetic Reconstruction, 2013.
  • G. Navarro and M. Raffinot. Flexible Pattern Matching in Strings. Cambridge University Press, 2002.
  • B. Smyth. Computing Patterns in Strings. Addison Wesley, 2003.

Survey articles