Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is a common subword?
Think about what part of the words is the same.
How does a brute force algorithm work?
Consider a systematic approach to find matches.
What is the aim of the brute force algorithm in this context?
Remember the problem we are trying to solve.
Brute force algorithms have a complexity of O(m * n^2).
Reflect on how many iterations are required.
Implement a brute force solution in Python to find the longest common subword.
Consider breaking your code into smaller functions for matching segments.
Devise a dynamic programming approach to optimize the search for the longest common subword.
Think about how you can store and reuse lengths of already found subwords.
5 more questions in this section. Enroll free to practise them all.
Enroll free