Skip to main content

Computational Complexity

  • Chapter
  • First Online:
Data Structures and Algorithms with Python

Part of the book series: Undergraduate Topics in Computer Science ((UTICS))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Kent D. Lee .

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics