← 02-02 Analyzing Algorithms Solution

• 1 Follower
• 32 Lines

Get Embed Code x Embed video Use the following code to embed this video. See our usage guide for more details on embedding. Paste this in your document somewhere (closest to the closing body tag is preferable): ```<script type="text/javascript" src='https://amara.org/embedder-iframe'></script> ``` Paste this inside your HTML body, where you want to include the widget: ```<div class="amara-embed" data-url="http://www.youtube.com/watch?v=Hf2_3Cg75EI" data-team="udacity"></div> ``` 1 Language

Showing Revision 1 created 10/03/2012 by Amara Bot.

1. The answer here is that all of these six factors can influence the running time of an algorithm.
2. So the size of the input, I think that's a rather obvious one so in the example of Alice--
3. if she is running her algorithm on a very small network that takes much shorter time
4. than if she is running it on the huge Python communication center network for example.
5. The structure of the input can also influence the running time of an algorithm.
6. So for example if the network was structured in a way that we find that it can be covered
7. with one or two monitoring devices, then the algorithm could worked in a way that
8. we could immediately stop and not need to look at more complex assignments.
9. Finally, the type of computer that we're using that is also very obvious one.
10. If you're using a computer that is much faster so say we're using a huge workstation
11. instead of a super laptop, then the algorithm would run much faster.
12. The amount of memory the computer has that can also be a very important factor,
13. although it might not be obvious at first sight while the memory has to do with running time.
14. Let's say the memory of your computer is not enough to keep all the data
15. that the algorithm is using and it has to use the hard disk for example to do some of the work
16. or the memory is not enough and the algorithm has to recalculate certain parts of the solution.
17. Memory is also an important factor for running time.
18. How the algorithm is implemented that is of course very important.
19. So are you using an implementation that is very efficient or do you have unnecessary code or
20. any data structures that are inefficient that can
21. make a huge difference in the practice when we run an algorithm.
22. And finally the programming language use that is of course a debate
23. that many people like to have that it certainly a factor.
24. So there are some programming languages that will make an algorithm run a lot faster
25. than other programming languages.
26. And so you need to think about if efficiency matters,
27. they usually also use a programming language that is suited for that.
28. That's quite a lot of factors to look at and actually, I think there are lots of other factors
29. that would also determine the running time of an algorithm.
30. So that's why when we talked about analyzing algorithms,
31. we'll have to work with the number of simplifications to focus on what's really important
32. and not have to take account of all these factors and all the countless others that you might think of.