I’m in awe that a beginner thought of levenshtein’s distance upfront and made room for it. Top work. But then a common beginner mistake is to assume everything is on Heap or everything is on stack. You could make an approximate guess on how many characters deep you want to go finding difference, allocate that up front (something like [256]) and restrict your search diff within that.
But overall, its good work. Was able to compile it hassle free.
If you feel like playing around, consider trying my Make fragment from this comment. See if it helps pick some bugs early on in development.
size_t* prev = malloc((m + 1) * sizeof(*prev)); size_t* cur = malloc((m + 1) * sizeof(*cur));I’m in awe that a beginner thought of levenshtein’s distance upfront and made room for it. Top work. But then a common beginner mistake is to assume everything is on Heap or everything is on stack. You could make an approximate guess on how many characters deep you want to go finding difference, allocate that up front (something like [256]) and restrict your search diff within that.
But overall, its good work. Was able to compile it hassle free.
If you feel like playing around, consider trying my Make fragment from this comment. See if it helps pick some bugs early on in development.