# Growth Rates

## Growth Rates

Algorithms analysis is all about understanding growth rates. It is about understanding the growth in resource consumption as the amount of data increases.  Typically, we describe the resource consumption growth rate of a piece of code in terms of a function (a "curve"). To help understand the implications, this section will look at graphs for some common growth rates from most efficient to least efficient.

### Constant

A constant resource need is one where the resource need does not grow. That is processing 1 piece of data takes the same amount of resource as processing 1 million pieces of data. The graph of such a growth rate looks like a horizontal line

&#x20;

![](/files/-LGTYaP8QuKpF4tugUKl)

### Logarithmic

A logrithmic growth rate is a growth rate where the resource needs grows by one unit each time the data is doubled. This effectively means that as the amount of data gets bigger, the curve describing the growth rate gets flatter (closer to horizontal but never reaching it). The following graph shows what a curve of this nature would look like.

![](/files/-LGTYlJZpUbd1oG-VJc5)

### Linear

A linear growth rate is a growth rate where the resource needs and the amount of data is directly proportional to each other. That is the growth rate can be described as a straight line that is not horizontal.

![](/files/-LGhjujStxCX1ZsRPn3T)

### Loglinear

A loglinear growth rate is a slightly curved line. the curve is more pronounced for lower values than higher ones

![](/files/-LGTZ2ZMWFlEij96zgyY)

### Quadratic

A quadratic growth rate is one that can be described by a parabola.

![](/files/-LGTZLVX_9L-oaGybctq)

### Cubic

While this may look very similar to the quadratic curve, it grows significantly faster

![](/files/-LGTZX792sLEfRzpU1BB)

### Exponential

An exponential growth rate is one where each extra unit of data requires a doubling of resource. As you can see the growth rate starts off looking like it is flat but quickly shoots up to near vertical (note that it can't actually be vertical)

![](/files/-LGT_jRKQkNbBz3QNO-G)

##


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://catherine-leung.gitbook.io/data-strutures-and-algorithms/algorithms-analysis/growth-rates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
