Question

Algorithms are to solve problems, or more precisely, to solve problems that have a precise mathematica...

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?

Homework Answers

Answer #1

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.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Algorithms are used all the time today to solve problems, even if people are not aware...
Algorithms are used all the time today to solve problems, even if people are not aware they are using them. Algorithms break down one big problem into many smaller problems or steps that can be more easily solved. One such problem in the business that can be solved with algorithms is how much profit are they making based on the sales of a product. The algorithm can be as follows: Step 1: How many of the product has been sold?...
: YOU MUST USE SWITCH STATEMENTS TO SOLVE THE NEXT TWO PROBLEMS DO NOT USE LOOPS!...
: YOU MUST USE SWITCH STATEMENTS TO SOLVE THE NEXT TWO PROBLEMS DO NOT USE LOOPS! For this problem you must run the program to show all of your menu options working, just like with Problem 1, you will have a screen shot for every menu option and then you will have a screen shot for entering a value that is not part of the menu option. Write a program that displays the following menu to the user: Welcome to...
DIscussion : So I'm sure that many of us have been in a grocery store, mall,...
DIscussion : So I'm sure that many of us have been in a grocery store, mall, park or religious establishment where families are hanging out, when, you notice a child misbehaving. I'm sure that we also notice how the child's caregiver(s) react to the child's behavior. Some may ignore the child, some may hold their child, some walk the child out into a different environment, and some may even hit their child. For this post, I would like for us...
Use C++ in Solving Ordinary Differential Equations using a Fourth-Order Runge-Kutta of Your Own Creation Assignment:...
Use C++ in Solving Ordinary Differential Equations using a Fourth-Order Runge-Kutta of Your Own Creation Assignment: Design and construct a computer program in C++ that will illustrate the use of a fourth-order explicit Runge-Kutta method of your own design. In other words, you will first have to solve the Runge-Kutta equations of condition for the coefficients of a fourth-order Runge-Kutta method.   See the Mathematica notebook on solving the equations for 4th order RK method.   That notebook can be found at...
Problem Definition: Problem: Given an array of integers find all pairs of integers, a and b,...
Problem Definition: Problem: Given an array of integers find all pairs of integers, a and b, where a – b is equal to a given number. For example, consider the following array and suppose we want to find all pairs of integers a and b where a – b = 3 A = [10, 4, 6, 16, 1, 6, 12, 13] Then your method should return the following pairs: 4, 1 15, 12 13, 10 A poor solution: There are...
Re word this reflection essay and include more studies on creativity in it. What have I...
Re word this reflection essay and include more studies on creativity in it. What have I Learned? I have learned how to use my brain better, to organize my thinking process in a way to facilitate my perceptions, creativity and innovative thinking methods in a more effective manner. I learned many ideas and findings on how human brain function. For example, according to Tony Buzan, the brain thinks in two ways: association or explosion method. I learned that to change...
Item Chapter 5 Planning Programs that Prevent Discipline Problems Quote of the Day #1: You can...
Item Chapter 5 Planning Programs that Prevent Discipline Problems Quote of the Day #1: You can discover more about a person in an hour of play than in a year of conversation. Plato This chapter focuses on planning programs that prevent discipline problems. I consider myself a "constructivist teacher". I think students learn best when the information is meaningful to them and the process engages their curiosity and exploration. I want to encourage students to explore ideas and develop them,...
This programming task will be a bit different. It will be more like what you would...
This programming task will be a bit different. It will be more like what you would receive if you were a maintenance engineer working in a corporate information systems or technology department. In other words, you will have some prebuilt source code provided for you that you must alter so it will meet the given programming specification.. Build a program from what you have been given as a starting-point. Rename the “starter code”. Do not add any modules; just, use...
Read the case study. Identify three (3) problems and recommendations to solve the problems. Each problem...
Read the case study. Identify three (3) problems and recommendations to solve the problems. Each problem will require a justified recommended solution at least a page each. Zappos CEO Asks Employees to Commit to Teal, or Leave Zappos had modest beginnings. In 1999, shoesite.com was started by Nick Swinmurn to capture online shoe sales. Swinmurn reached out to Tony Hsieh (pronounced “shay”) and Alfred Lin, who were running Venture Frogs, a kind of venture capital group, for advice and funding....
I. Rational Actor Approach to Problem Solving (10 pts)                                 &nb
I. Rational Actor Approach to Problem Solving (10 pts)                                                    Early in the semester we reviewed a simple three question approach to diagnosing problems based on the economic perspective of rational actors (recorded video lecture). Answer/diagnose the following questions using this three question framework for the “Rational Actor Paradigm”. As a reminder, the three questions were: Who is making the (bad) decision? [i.e. should we/they let someone else decide] Does the decision maker have enough or the right information to make...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT