Sunday, November 2, 2014

sLog Week 8: How Complex Is Your Complexity?

     This week we discussed the run-time of functions (more particularly sorting algorithms). I found it interesting to think of Python functions as as actual mathematical functions that have a certain fixed complexity depending on the 'calculations' happening within it. It was a fascinating way of combining basic algebra and applying it to proofs of the complexity of programs. I think it's important to be aware of the complexity of certain functions (including sorts) while writing programs, as it lets you know how efficient or inefficient your code actually is. Although it may seem like a few milliseconds here or there with every addition of a while-loop, I know that on large-scale tests of functions, each loop and if-statement will add up. I'm glad I'm being exposed to this logical way of thinking about programs and run-time this early on in my Computer Science studies, as I'm sure it will come in handy in my actual programming courses.

No comments:

Post a Comment