CMSC 132A Final: CMSC 132A - Final Exam

50 views33 pages

Document Summary

Note: the exam is may 14th from 4-6 pm at phy 1410. Algorithmic complexity is concerned with how fast or how slow a particular algorithm runs. We can define algorithm complexity as a function of time: t (n, where n is the input size. This measures time versus the input size we give the algorithm: we (cid:272)a(cid:374)(cid:859)t (cid:373)easu(cid:396)e the ti(cid:373)e di(cid:396)e(cid:272)tly! The time an algorithm takes to run depends on many factors such as processor speed, disk speed, type of compiler, etc. That is why we are focused on the asymptotic behavior or end behavior of our time function: let(cid:859)s look at the additio(cid:374) of t(cid:449)o i(cid:374)tegers. We add the two integers bit by bit, and we see that this will take n unit of time. We therefore say that the addition of two integers takes a linear amount of time. As the size of the integers grows, the time it takes to add them will grow linearly.