Z algorithm and KMP algorithm - Lesson plan

Learning outcomes

  • able to evaluate performance of matching algorithms in terms of number of comparisons
  • understand how pre-computing exact matches helps matching
  • able to compute Z values
  • understand why Z value computation is linear time
  • able to understand why precomputed sp values help speed up alignment
  • able to compute sp' values from Z values
  • able to compute sp values using traditional KMP approach

Class plan

Exercises

Rosalind KMP

Rosalind SUBS - compare speed with Rosalind 1C from previous submission

 Exercises from handout

Additional resources

https://youtu.be/CpZh4eF8QBw Links to an external site.

https://ivanyu.me/blog/2013/10/15/z-algorithm Links to an external site.

https://www.youtube.com/watch?v=rfisBOOLN9M Links to an external site. Links to an external site.

https://www.utdallas.edu/~besp/demo/John2010/z-match.htm Links to an external site.