Hi everyone,
I am trying to come up with a solution to a problem that seems simple to me, being a noob.
Lets assume that there is a file containing a random access machine program (or a program in similar, simple, assembly - like language). The task is to read the file - and to _estimate_ how long will it take to execute that program. For simplicity's sake lets assume that there won't be endless loops.
What'd be the best approach to this kind of problem? Any ideas?
Should we put symbols into hashtable - then read the file, check if a command is correct and ... then what? What is the best way to estimate the run-time? Is it actually possible, without actually running the program (emulating the machine on which the program executes). I know that its time complexity we're dealing here with... Any suggestions on how to approach that kind of problem?
Any help would be very much appreciated.