Content-Length: 283126 | pFad | http://github.com/zph001/JavaScript/commit/59760f75c455182e09ab3f74e638c4c01fe1e89c

2E merge: Add test case to Edit Distance Algorithm (#1044) · zph001/JavaScript@59760f7 · GitHub
Skip to content

Commit 59760f7

Browse files
Ankush263github-actions
andauthored
merge: Add test case to Edit Distance Algorithm (TheAlgorithms#1044)
* Add test case to Edit Distance Algorithm * Updated Documentation in README.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
1 parent f5be6b2 commit 59760f7

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { minimumEditDistance } from '../EditDistance'
2+
3+
test('minimumEditDistance(kitten, sitten) => 1', () => {
4+
const str1 = 'kitten'
5+
const str2 = 'sitten'
6+
const res = minimumEditDistance(str1, str2)
7+
expect(res).toEqual(1)
8+
})
9+
10+
test('minimumEditDistance(school, skull) => 4', () => {
11+
const str1 = 'school'
12+
const str2 = 'skull'
13+
const res = minimumEditDistance(str1, str2)
14+
expect(res).toEqual(4)
15+
})
16+
17+
test('minimumEditDistance(Algorithm, Algorithm) => 0', () => {
18+
const str1 = 'Algorithm'
19+
const str2 = 'Algorithm'
20+
const res = minimumEditDistance(str1, str2)
21+
expect(res).toEqual(0)
22+
})

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/zph001/JavaScript/commit/59760f75c455182e09ab3f74e638c4c01fe1e89c

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy