1. Why is the order of an algorithm generally more important than the speed of t
ID: 644943 • Letter: 1
Question
1. Why is the order of an algorithm generally more important than the speed of the processor?
2. Write the simplest big-O expression to describe the number of operations required for the following algorithm:
for (i = 1; i < N; ++i)
{
...statements that require exactly i operations...
}
3. You are at a computer science cocktail party and you meet a student who has just started working with a debugger. With about three or four sentences, explain the basic features of your debugger and how they help you find bugs?
Explanation / Answer
1.Complexity is always more important than hardware resources as the size of the data increases. An O(n*log(n)) algorithm will finish faster on an 30 years old computer than an O(n!) or O(n*n) on today's most expensive hardware if n is big enough.
Take it with a grain of salt. More computing power basically just means that your n can become much larger before it significantly slows down. For most everyday problems, this n is now large enough that you don't need to care. However, you should still know the complexities of your algorithms.
With more available resources, it may need to crunch more data later. Today you need to analyze a 10MB log file with 100,000 lines. In a year you may have a 100GB log file with 1,000,000,000 lines. If the amount of data grows faster than the resource powers, you run into problems later.
2. O(n^2)
3.Typically, debuggers offer a query processor, symbol resolver, expression interpreter, and debug support interface at its top level. Debuggers also offer more sophisticated functions such as running a program step by step (single-stepping or program animation), stopping (breaking) (pausing the program to examine the current state) at some event or specified instruction by means of a breakpoint, and tracking the values of variables.
The same functionality which makes a debugger useful for eliminating bugs allows it to be used as a software cracking tool to evade copy protection, digital rights management, and other software protection features. It often also makes it useful as a general verification tool, fault coverage, and performance analyzer, especially if instruction path lengthsare shown.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.