Loading repository data…
Loading repository data…
rajendrapancholi / repository
This repository contains implementations of various data structures in C++. Each data structure is implemented with its basic operations, such as insertion, deletion, and traversal. The aim is to provide clear, well-documented code examples to help understand the underlying concepts and algorithms.
This repository contains implementations of various data structures in C++. Each data structure is implemented with its basic operations, such as insertion, deletion, and traversal. The aim is to provide clear, well-documented code examples to help understand the underlying concepts and algorithms.
To get a local copy up and running, follow these simple steps.
You need to have a C++ compiler installed on your machine. For example, you can use g++, which is part of the GNU Compiler Collection.
Install MinGW:
Verify Installation:
g++ --version
to verify the installation.Compile the desired data structure file using the C++ compiler and run the executable. Each data structure implementation comes with a main function demonstrating its usage.
g++ src/array.cpp -o array
./array
Install g++:
sudo apt-get install g++
Install Homebrew if you haven't already:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install g++:
brew install gcc
Arrays are collections of items stored at contiguous memory locations. The idea is to store multiple items of the same type together.
A linked list is a linear data structure where each element is a separate object. Each element (node) contains a reference to the next node.
Stack is a linear data structure which follows a particular order in which the operations are performed. The order may be LIFO (Last In First Out) or FILO (First In Last Out).
Queue is a linear structure which follows a particular order in which the operations are performed. The order is First In First Out (FIFO).
A tree whose elements have at most 2 children is called a binary tree. Each element is called a node, and the top node is called the root.
Binary Search Tree is a node-based binary tree data structure with the following properties:
The left subtree of a node contains only nodes with keys lesser than the node’s key. The right subtree of a node contains only nodes with keys greater than the node’s key. The left and right subtree each must also be a binary search tree.
A Heap is a special Tree-based data structure in which the tree is a complete binary tree. Generally, Heaps can be of two types:
A Graph is a non-linear data structure consisting of nodes and edges. Nodes are sometimes referred to as vertices, and edges are lines or arcs that connect any two nodes in the graph.
A Hash Table is a data structure which stores data in an associative manner. In a hash table, data is stored in an array format, where each data value has a unique key associated with it.
We welcome contributions! If you'd like to improve existing solutions, add new ones, or fix bugs, please consider the following steps:
git checkout -b feature/your-feature).git commit -m 'Add feature').git push origin feature/your-feature).For any queries or feedback, feel free to reach out:
Happy Coding Journey! 👨💻👩💻