/Data_Structure

Repo for exploring and implementing various data structures.

Primary LanguageC++MIT LicenseMIT

Data Structures with C++

This repository contains various data structure implementations and algorithms in C++.

Overview

Data structures are fundamental concepts in computer science that allow efficient organization, storage, and manipulation of data. This repository aims to provide clear implementations of common data structures using C++.

Types of Data Structures

Data structures can be broadly categorized into two main types:

  1. Linear Data Structures: Store data in a sequential order

    • Arrays
    • Linked Lists
    • Stacks
    • Queues
  2. Non-Linear Data Structures: Store data in a hierarchical or networked order

    • Trees
    • Graphs
    • Heaps
    • Hash Tables

Implemented Data Structures

This repository includes implementations of the following data structures:

Array

A collection of data elements of the same type, stored in contiguous memory locations. Arrays can be fixed-size or dynamic:

  • Fixed-size arrays: Have a predetermined length that cannot be changed after creation.
  • Dynamic arrays: Can grow or shrink in size as needed, automatically reallocating memory.

Linked List

A dynamic collection of data elements (nodes) linked together by pointers.

Stack

A linear data structure following the LIFO (Last In First Out) principle.

Queue

A linear data structure following the FIFO (First In First Out) principle.

Binary Search Tree

A special type of binary tree that maintains a sorted order of elements.

Graph

A non-linear data structure consisting of vertices and edges.

Installation

To clone this repository, run the following command in your terminal:

git clone https://github.com/A-A7med-i/Data_Structure.git

Usage

Each data structure is implemented in its own file. To use a specific data structure, include the corresponding header file in your C++ program.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is open source and available under the MIT License.