/data-structure-and-algorithms

dataStructure-and-algorithms in Python and Java

Primary LanguagePythonMIT LicenseMIT

Algorithms & Data Structure

License

In this github repo, I use python 3.7.* and Java 8 to build different type of data data Structure and algorithms, feel free to ask me, add new issue and fork 😀.

Authors

See also the list of contributors who participated in this project.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Python 🐍

Prerequisites

  • Python >= 3.7.
  • pip3

Installing

A step by step series of examples that tell you how to get a development env running

  1. clone the repo to your local machine using
    $ git clone https://github.com/SalAlba/dataStructure-and-algorithms.git
    $ cd dataStructure-and-algorithms
  1. create virtual env and run using
    $ virtualenv  venv
    $ source venv/bin/activate
  1. install all requirements using
    $ pip install -r requirements.txt

Java

  1. how to run java program from terminal/console [src]
# compile the program
$ javac path/to/ClassName.java

# run compiled program
$ java ClassName

Topics

Algorithm complexity

Algorithmic complexity (code complexity) it is how particular algorithm performs, fast or slow. the complexity is defined as numeric function T(n). want to measure the time taken by the algorithm without dive into the implementation [src]

In Algorithmic Complexity we take care of this three measurement. Big-O, Sigma, Theta. [1.1.]

  1. Big-O (Worst case) - Use an input that gives the slowest performance.
  2. Sigma (Best case) - Use an input that give, the best results.
  3. Theta (Average case) - Assumes the input is random.

algorithm-time-complexity.png

TODO

  1. How to measure the complexity?

Data strucure

Arrays [Python] | [Java]

  1. search O(n).
  2. access O(1).
  3. insert O(n).
  4. delete O(n).

If we want access to value super fast, so go with array that why use, but if you want be faster in adding new values, editing value, or removing in this case arrays is not the best solutios. The dark side ☠️ of array, when we create the array we need to specfin the length of array at the beginning, where it reserve a fixed place in memory and could be not used, it's west of momeroy location.

Algorithm

TODO ...

Notes / Things you should to know

TODO

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

License

License

This project is licensed under the MIT License - see the LICENSE.md file for details, Copyright 2020 © Salem Albarudy.

Acknowledgments

  • Hat tip to anyone whose code was used
  • Inspiration
  • etc

Recommendations / How to learn

Resources

1. Books

2. Websites

3. Youtube

4. Papers