jesus33-avatar

What is Time Complexity and Space Complexity measures of Algorithm?

Please provide some information on the Time Complexity and Space Complexity measures of an Algorithm?
0%

8 replies

over 13 years ago
danmarino-avatar
"The time complexity of a problem is the number of steps that it takes to solve an instance of the problem as a function of the size of the input (usually measured in bits), using the most efficient algorithm. To understand this intuitively, consider the example of an instance that is n bits long that can be solved in n² steps. In this example we say the problem has a time complexity of n². Of course, the exact number of steps will depend on exactly what machine or language is being used. To avoid that problem, the Big O notation is generally used (sometimes described as the ""order"" of the calculation, as in ""on the order of""). If a problem has time complexity O(n²) on one typical computer, then it will also have complexity O(n²) on most other computers, so this notation allows us to generalize away from the details of a particular computer. Example : Mowing grass has linear time complexity because it takes double the time to mow double the area. However, looking up something in a dictionary has only logarithmic time complexity because a double sized dictionary only has to be opened one time more (i.e. exactly in the middle, then the problem size is reduced by half). The space complexity of a problem is a related concept, that measures the amount of space, or memory required by the algorithm. An informal analogy would be the amount of scratch paper needed while working out a problem with pen and paper. Space complexity is also measured with Big O notation. Source: http://in.docsity.com/en-docs/Algorithms_and_Application_Programming__Lecture_notes__KUMAR"
over 13 years ago
loche-avatar
" most of us executed a straightforward searching formula, sorting through minimum lookup. Most of us used it at this time there to kind characters; we all also could variety figures or even strings by it since it is simply dependant on reviews as well as trading. Almost all we need to because of kind strings with the exact same formula would be to exchange the type name variety inside the seed value through assortment... and now we may form a whole phone book: the telephone volume involving Saarbrücken, involving Munich, involving Belgium. Can we truly? "