Algorithms I suggest to check out the following post first: http://badearobert.ro/2019/05/03/algorithms-dynamic-programming-longest-common-subsequence-lcs/ Edit distance refer to minimum number of moves to make two strings equal. The Levenshtein distance is a string metric for measuring difference between two sequences. Informally, the Levenshtein distance between two words is the minimum number of single-character edits […]

Algorithms – Dynamic Programming – Edit distance (Levenshtein) Let’s implement the following problem: Given two strings A and B of equal lengths, containing only lower case letters, our job is to count the minimum number of changes required on string A to make it equal to string B. Let’s first talk what is a subsequence. A subsequence is […]

Algorithms – Dynamic Programming – Longest Common Subsequence (LCS) Sudoku is a number placement puzzle, where the objective is to fill a square grid of size n, with numbers between 1 to n. As constraints, each row, column, and sub-grids should contain empty spaces or unique numbers from 1 to n. Step-by-step algorithm With backtracking, we try to add […]

Algorithms – Backtracking – Sudoku Hello everyone, let’s talk about the Huffman encoding. The algorithm was taken from here  and slightly modified to be more clear. As this algorithm is fairly simple and Internet is full of explanation regarding it, I will not go in too much detail. The algorithm is compressing the number of […]