Abstract
In the last chapter we developed a drawing program. To hold the drawing commands we built the PyList container class which is a lot like the built-in Python list class, but helps illustrate our first data structure. When we added a drawing command to the sequence we called the append method. It turns out that this method is called a lot. In fact, the flower picture in the first chapter took around 700 commands to draw. You can imagine that a complex picture with lots of free-hand drawing could contain thousands of drawing commands. When creating a free-hand drawing we want to append the next drawing command to the sequence quickly because there are so many commands being appended. How long does it take to append a drawing command to the sequence? Can we make a guess? Should we care about the exact amount of time? In this chapter you’ll learn how to answer these questions and you’ll learn what questions are important for you as a computer programmer. First you’ll read about some principles of computer architecture to understand something about how long it takes a computer to do some simple operations. With that knowledge you’ll have the tools you’ll need to make informed decisions about how much time it might take to execute some code you have written.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2015 Springer International Publishing Switzerland
About this chapter
Cite this chapter
Lee, K.D., Hubbard, S. (2015). Computational Complexity. In: Data Structures and Algorithms with Python. Undergraduate Topics in Computer Science. Springer, Cham. https://doi.org/10.1007/978-3-319-13072-9_2
Download citation
DOI: https://doi.org/10.1007/978-3-319-13072-9_2
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-13071-2
Online ISBN: 978-3-319-13072-9
eBook Packages: Computer ScienceComputer Science (R0)