# Data Structure and Algorithms Complexity (Big-O)

Big-O notation is a mathematical representation used to describe the complexity of a data structure and algorithm. There are two types of Complexity :

1. Time Complexity: Its measure based on steps need to follow for an algorithm.
2. Space Complexity: It measures the space required to perform an algorithm and data structure.

## Data Structure and Algorithm Decision

Data structure and algorithm decisions are based on the complexity of size and operations need to perform on data. Some algorithms perform better on a small set of data while others perform better for big data sets for certain operations.

These days Space Complexity is not big concerns but the main performance of an algorithm measures based on time complexity. We can make the decision to choose an algorithm based on below performance criteria with respect to Complexity.

 Complexity Performance O(1) Excellent O(log(n)) Good O(n) Fair O(n log(n)) Bad O(n^2) Horrible O(2^n) Horrible O(n!) Horrible

This post almost covers data structure and algorithms space and time Big-O complexities. Here you can also see time complexities for types of operations like access, search, insertion, and deletion.