README
What is this repository for
- Algorithms and Data Structures class
- Class notes
- Code templates
How do I get set up
Windows users may have to substitute python3 with py -3 for the following commands to work. You should keep the same file structure as this repository and run all the commands from its top directory (i.e. ads-class-pub).
- Clone the repository.
git clone https://github.com/LutherCS/ads-class-pub.git
- Get updates.
git pull origin
- Install pythonds3 to use textbook implementations of various data structures and algorithms.
python3 -m pip install -U pythonds3
- Install linters pylint and mypy.
python3 -m pip install -U pylint mypy
- Install formatter black.
python3 -m pip install -U black
- Install testing framework pytest and its plugin pytest-timeout.
python3 -m pip install -U pytest pytest-timeout
- Install colorama to colorize output.
python3 -m pip install -U colorama
How do I run my code
- Run project hello
python3 src/projects/hello/hello.py
- Run project hello that takes file data.in as input
python3 src/projects/hello/hello.py data/projects/hello/data.in
The source should be modified as follows (sys.argv contains all the arguments passed to the application, including the application file name itself as sys.argv[0]):
import sys
def main(filename):
print('Processing file {}'.format(filename))
if __name__ == '__main__':
main(sys.argv[1])
- Test project hello
python3 -m pytest tests/projects/hello/test_hello.py
- Run exercise hello
python3 src/exercises/hello/hello.py
- Test exercise hello
python3 -m pytest tests/exercises/hello/test_hello.py
References
Text Editors and IDEs
Popular development environments include the following:
Tools and Utilities
- An Introduction to the Linux Terminal | DigitalOcean
- git - the simple guide - no deep shit!
- Installing Packages — Python Packaging User Guide
- Pipenv: A Guide to the New Python Packaging Tool – Real Python
- pytest: helps you write better programs — pytest documentation
Python Basics
- The Python Standard Library — Python 3.7.0 documentation
- PEP 8 -- Style Guide for Python Code | Python.org
- Python Style Guidelines - The Chromium Projects
- mattharrison/Tiny-Python-3.6-Notebook: This repository contains the text for the Tiny Python 3.6 Notebook.
- crazyguitar/pysheeet: Python Cheat Sheet
Exception Handling
Object-Oriented Programming
- Python @property: How to Use it and Why? - Programiz
- Introduction to Python descriptors – IBM Developer
- Python Tutorial: Properties vs. getters and setters
- Descriptor HowTo Guide — Python 3.7.2 documentation
- Object-Oriented Programming (OOP) in Python 3 – Real Python
- Jupyter Notebook Viewer - The Tao of Python
- 3. Data model — Python 3.7.0 documentation
- Underscores in Python
- Python3 Tutorial: Magic Methods
- Python Class Examples: Init and Self - Dot Net Perls
- The self variable in python explained | Python Tips
- OOP - Inheritance
- An Introduction to Classes and Inheritance (in Python) - Jessica Hamrick
- Learn Python the Hard Way - Read for Free
- Python3 Tutorial: Inheritance
Algorithm Analysis
- Analysis of Algorithms
- A Gentle Introduction to Algorithm Complexity Analysis
- Analysis of Algorithms
Basic Data Structures
Recursion
- In plain English, what is recursion? - Software Engineering Stack Exchange
- An Introduction to Recursion, Part 1 – topcoder
- An Introduction to Recursion: Part 2 – topcoder
Searching Algorithms
- Data Structures and Algorithms Hash Table
- Basics of Hash Tables Tutorials & Notes | Data Structures | HackerEarth
Sorting Algorithms
- Sorting algorithms visualized with animated color palette | FlowingData
- Sorting Algorithm Animations | Toptal
- VisuAlgo - Sorting (Bubble, Selection, Insertion, Merge, Quick, Counting, Radix)