Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 

README.md

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

Python Basics

Exception Handling

Object-Oriented Programming

Algorithm Analysis

Basic Data Structures

Recursion

Searching Algorithms

Sorting Algorithms

Trees

Graphs

You can’t perform that action at this time.