# Data Structures

## Core Concepts

Every computer science problem is solved with the help of data structures. Every structure has strengths and weaknesses. And one of the most important things to understand is the complexity of the Data Structure in both time and space.

**Time complexity** determines the **speed** of a given operation.
And **space complexity** determines the **amount of memory** required by the operation.

Understanding the time and space complexity for a wide array of data-structures allows a person to "use the right tool for the job" when it comes to solving novel problems.

## Strings

A String is a sequence of characters.

## Collections

A List is a **linear** Collection of values
**addressable by a positive integer**.

A Map is a Collection of values **addressable by a unique key**.

A Set is a Collection of **unique values**.

A Tree is a Collection of **Nodes** which **contain a value**
and a **List of references** to other Nodes.

A Graph is a Collection of **Nodes**, each with a **List of
references** called **Edges** which connect Nodes to each other.

Trees and Graphs are similar in basic ways. But the constraints on the two data structures are very different. Read more about the differences between trees and graphs.

A Priority Queue is a Collection of values, each of which has a
**priority** attribute. Values **are added in any order** and **pulled out in
priority order** from highest to lowest.