Skip to content

maydaythecoder/DSA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Data Structures and Algorithms (DSA)

This repository contains implementations of various data structures and algorithms in JavaScript, Python, and Java. The goal is to provide a resource for learning and understanding the fundamentals of data structures and algorithms, with examples in three popular programming languages.

Project Structure

The project is organized into the following main directories:

  • JavaScript/
  • Python/
  • Java/

Each language directory contains two subdirectories:

  • DataStructures/
  • Algorithms/

Directory Structure

DSA/
├── JavaScript/
│ ├── DataStructures/
│ │ ├── Array.js
│ │ ├── Hashmaps.js
│ │ ├── LinkedList.js
│ │ ├── Queue.js
│ │ └── Stack.js
│ └── Algorithms/
│   ├── BinarySearch.js
│   ├── BubbleSort.js
│   └── LinearSearch.js
├── Python/
│ ├── DataStructures/
│ │ ├── array.py
│ │ ├── Hash_maps.py
│ │ ├── linked_list.py
│ │ ├── queue.py
│ │ └── stack.py
│ └── Algorithms/
│   ├── binary_search.py
│   ├── bubble_sort.py
│   └── linear_search.py
└── Java/
  ├── DataStructures/
  │ ├── Array.java
  │ ├── Hashmaps.java
  │ ├── LinkedList.java
  │ ├── Queue.java
  │ └── Stack.java
  └── Algorithms/
    ├── BinarySearch.java
    ├── BubbleSort.java
    └── LinearSearch.java

Data Structures

The following data structures are implemented in JavaScript, Python, and Java:

  • Array: A collection of elements identified by index.
  • LinkedList: A linear collection of nodes where each node points to the next node.
  • Queue: A collection of elements that follows the FIFO (First In First Out) principle.
  • Stack: A collection of elements that follows the LIFO (Last In First Out) principle.

DataStructures in JavaScript

  • Array.js: Implementation of array operations.
  • LinkedList.js: Implementation of a singly linked list.
  • Queue.js: Implementation of a queue.
  • Stack.js: Implementation of a stack.

DataStructures in Python

  • array.py: Implementation of array operations.
  • linked_list.py: Implementation of a singly linked list.
  • queue.py: Implementation of a queue.
  • stack.py: Implementation of a stack.

DataStructures in Java

  • Array.java: Implementation of array operations.
  • LinkedList.java: Implementation of a singly linked list.
  • Queue.java: Implementation of a queue.
  • Stack.java: Implementation of a stack.

Algorithms

The following algorithms are implemented in JavaScript, Python, and Java:

  • Binary Search: An efficient algorithm for finding an item from a sorted list of items.
  • Bubble Sort: A simple sorting algorithm that repeatedly steps through the list to be sorted.
  • Linear Search: A simple search algorithm that checks every element until the target is found or the list ends.

Algorithms in JavaScript

  • BinarySearch.js: Implementation of binary search algorithm.
  • BubbleSort.js: Implementation of bubble sort algorithm.
  • LinearSearch.js: Implementation of linear search algorithm.

Algorithms in Python

  • binary_search.py: Implementation of binary search algorithm.
  • bubble_sort.py: Implementation of bubble sort algorithm.
  • linear_search.py: Implementation of linear search algorithm.

Algorithms in Java

  • BinarySearch.java: Implementation of binary search algorithm.
  • BubbleSort.java: Implementation of bubble sort algorithm.
  • LinearSearch.java: Implementation of linear search algorithm.

Getting Started

To get started with the project, clone the repository and navigate to the respective directory (JavaScript, Python, or Java) to explore the implementations.

git clone https://github.com/maydaythecoder/DSA
cd DSA

Running the Code

JavaScript

To run the JavaScript code, ensure you have Node.js installed. Navigate to the respective file and run it using Node.js.

cd JavaScript/DataStructures
node Array.js
cd JavaScript/Algorithms
node LinearSearch.js

Python

To run the Python code, ensure you have Python installed. Navigate to the respective file and run it using Python.

cd Python/DataStructures
python array.py
cd Python/Algorithms
python linear_search.py

Java

To run the Java code, ensure you have Java Development Kit (JDK) installed. Navigate to the respective file, compile, and run it using javac and java.

cd Java/DataStructures
javac Array.java
java Array
cd Java/Algorithms
javac LinearSearch.java
java LinearSearch

Contributing

Contributions are welcome! If you have any improvements or additional data structures/algorithms to add,
please fork the repository, make your changes, and submit a pull request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published