O'Reilly logo

Python Unlocked by Arun Tigeraniya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Algorithms on scale

Key 4: Thinking out-of-the-box for the algorithms.

An algorithm is how we solve a problem. The most common issue of not being able to solve the problem is to not being able to define it properly. Normally, we look to apply an algorithm only at a small level, such as in a small functionality, or sorting in a function. We, however, do not think about algorithms when the scale increases, mostly the stress is on how fast it is. Let's take a simple requirement of sorting a file and sending it to a user. If the file is, let's say 10-20 KB or so, it will be best to simply use the Python sorted function to sort the entries. In the following code, the file is of format where columns are ID, name, due, and due-date. We want to sort ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required