summaryrefslogtreecommitdiffstats
path: root/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-11-13 21:18:32 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-11-13 21:18:32 +0100
commitbc75b20fc0e80d6037ee14e3dccc2d88823f5f2f (patch)
treea45d61c5be8df717a28904d434287b88d94a1843 /01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance
parent36260c39bee50e6160c99e240fcad63402e39346 (diff)
downloadcoursera-bc75b20fc0e80d6037ee14e3dccc2d88823f5f2f.zip
coursera-bc75b20fc0e80d6037ee14e3dccc2d88823f5f2f.tar.gz
Algorithms : add 01-algorithmic_toolbox 04-dynamic_programming
Diffstat (limited to '01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance')
-rw-r--r--01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/edit_distance.cpp17
-rw-r--r--01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/012
-rw-r--r--01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/01.a1
-rw-r--r--01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/022
-rw-r--r--01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/02.a1
-rw-r--r--01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/032
-rw-r--r--01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/03.a1
7 files changed, 26 insertions, 0 deletions
diff --git a/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/edit_distance.cpp b/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/edit_distance.cpp
new file mode 100644
index 0000000..fd7d16e
--- /dev/null
+++ b/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/edit_distance.cpp
@@ -0,0 +1,17 @@
+#include <iostream>
+#include <string>
+
+using std::string;
+
+int edit_distance(const string &str1, const string &str2) {
+ //write your code here
+ return 0;
+}
+
+int main() {
+ string str1;
+ string str2;
+ std::cin >> str1 >> str2;
+ std::cout << edit_distance(str1, str2) << std::endl;
+ return 0;
+}
diff --git a/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/01 b/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/01
new file mode 100644
index 0000000..367ac87
--- /dev/null
+++ b/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/01
@@ -0,0 +1,2 @@
+ab
+ab
diff --git a/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/01.a b/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/01.a
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/01.a
@@ -0,0 +1 @@
+0
diff --git a/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/02 b/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/02
new file mode 100644
index 0000000..3ef52c8
--- /dev/null
+++ b/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/02
@@ -0,0 +1,2 @@
+short
+ports
diff --git a/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/02.a b/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/02.a
new file mode 100644
index 0000000..00750ed
--- /dev/null
+++ b/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/02.a
@@ -0,0 +1 @@
+3
diff --git a/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/03 b/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/03
new file mode 100644
index 0000000..cc5b276
--- /dev/null
+++ b/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/03
@@ -0,0 +1,2 @@
+editing
+distance
diff --git a/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/03.a b/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/03.a
new file mode 100644
index 0000000..7ed6ff8
--- /dev/null
+++ b/01-algorithmic_toolbox/04-dynamic_programming/03-edit_distance/tests/03.a
@@ -0,0 +1 @@
+5