# Data Structures

## What is a Data Structure?

A **data structure** (DS) is a way of organizing data so that it can be used effectively.

## Abstract Data Types vs. Data Structures

An **abstract data type** (ADT) is an abstraction of the data structure which provides only the interface to which a data structure must adhere to.

The interface doest not give any specific details about how something should be implemented or in what programming language.

## Examples

| Abstraction (ADT) |   Implementation (DS)   |
| :---------------: | :---------------------: |
|        List       |      Dynamic Array      |
|                   |       Linked List       |
|       Queue       | Linked List based Queue |
|                   |    Array based Queue    |
|                   |    Stack based Queue    |
|        Map        |         Tree Map        |
|                   |  Hash Map / Hash Table  |
|      Vehicle      |        Golf Cart        |
|                   |         Bicycle         |

## Runtime Complexity

Describes the performance of the algorithm. Ref [Time complexity](https://en.wikipedia.org/wiki/time_complexity)

## Big O

* `N / O(n)` - 'linear' runtime
* `N^2` / `(n\*n)` / `O(n^2)` - N-square or quadratic runtime


---

# 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://alexgrischuk.gitbook.io/wiki/coding/ds.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.
