Algorithms are to solve problems, or more precisely, to solve problems that have a precise mathematica definition. However, in practice, figuring out what is exactly the problem is not easy at all. (You may search internet) Suppose that you would like to write an algorithm to decide the similarity between two C programs. What would you do?
It is very difficult to compare the functionality of two programs using an algorithm. We can compare syntax of the code between two C programs. But in order to compare the functionality of two programs we have to compare the source code of the program.
Step Number 1:
Figure out the parse tree of the first C program which consists of variables, operations and used data structures.
Step Number 2:
Figure out the parse tree of the second C program which consists of variables, operations and used data structures.
Step Number 3:
Compare both the parse trees using parse tree kernel.
Step Number 4:
Compute the similarity between the source codes.
Step Number 5:
Display the result.
Hope this helps.
Get Answers For Free
Most questions answered within 1 hours.