Skip to Main Content
Hands-On Software Architecture with Golang
book

Hands-On Software Architecture with Golang

by Jyotiswarup Raiturkar
December 2018
Intermediate to advanced content levelIntermediate to advanced
500 pages
12h 19m
English
Packt Publishing
Content preview from Hands-On Software Architecture with Golang

Algorithm complexity

Time complexity of an algorithm defines the amount of time taken by an algorithm to run as a function of the input size. Similarly, the space complexity of an algorithm gives a measure for the amount of space (memory) taken by an algorithm to run for a specific length of the input. These complexity metrics define how much time and space an algorithm takes with an increasing amount of data (inputs on which the algorithm has to work on).

For example, consider the problem of adding two numbers. Here, we will look at each digit pair in the two integers, add them, and then move to the next digit pair. If we had to denote the time taken to perform this addition, we could model it as, T(n) = c * n:

  • Here T(n) is the time taken ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Event-Driven Architecture in Golang

Event-Driven Architecture in Golang

Michael Stack

Publisher Resources

ISBN: 9781788622592Supplemental Content