© Elshad Karimov 2020
E. KarimovData Structures and Algorithms in Swifthttps://doi.org/10.1007/978-1-4842-5769-2_13

13. Big O

Elshad Karimov1 
(1)
New York, New York, USA
 

To describe the efficiency of algorithms, Big O time language and metric is used. To make it clearer, let’s look at the following scenario. Imagine that we want to send a file to our friend as fast as possible, how should we send it?

There are two options:
  • Electronic transfer

  • Physical delivery

Time Complexity

The concept of asymptotic runtime or Big O means time complexity . Which means we could describe the data transfer algorithm runtime as follows (Figure 13-1):
  • Electronic transfer: O(s), where s is the size of the file. This means that the time to transfer the file increases linearly ...

Get Data Structures and Algorithms in Swift: Implement Stacks, Queues, Dictionaries, and Lists in Your Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.