There have four interesting algorithms including LCSS, Floyd-Warshall, Dijkstra and 8-puzzle problem by BFS.
All of them were implemented by C++.
- Input:
- number of test data
- first string
- second string
-
Output:
length of same substring. -
Sample input:
3
aabbacd
aabacab
mississippi
ispim
1123123
111233 -
Sample output:
5
4
5
- Input:
- (int) m, n where m is total edges and n is total vertices.
- m numbers of weight for edges, like (a b 3) means it needs three points from a to b.
-
Output:
two dimensional metrix which contain weight from each vertice to others vertices.
if vertice cannot connect to one vertices, represent it "INF". -
Sample input:
5 9
a b 3
a c 8
b d 1
a e -4
c b 4
b e 7
d c -5
d a 2
e d 6 -
Sample output:
0 1 -3 2 -4
3 0 -4 1 -1
7 4 0 5 3
2 -1 -5 0 -2
8 5 1 6 0
- Input:
- two vertices including stant and goal.
- (int) m which means numbers of edge.
- m numbers of weight for edges, like (a b 3) means it needs three points from a to b.
-
Output:
length from start vertice to goal vertice. -
Sample input:
s d
10
s a 6
s c 3
a c 4
a b 2
b d 1
c a 2
c b 3
c d 5
d a 1
d b 5 -
Sample output:
7
- Input:
- three lines of numbers(0~8) which represent the original state.
- three lines of numbers(0~8) which represent the goal state.
-
Output:
the procedure of searching goal by BFS. -
Sample output:
1 2 3
7 8 4
0 6 5
1 2 3
8 0 4
7 6 5 -
Sample output:
1 2 3
7 8 4
0 6 5
1 2 3
0 8 4
7 6 5
1 2 3
7 8 4
6 0 5
0 2 3
1 8 4
7 6 5
1 2 3
8 0 4
7 6 5