Skip to content

jd3johns/dsa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Data Structures and Algorithms in C++ and Python

Completed

Bit Manipulation

  • Integer add without arithmetic operators: C++
  • Bitfield manipulation functions (test, set, clear): C++

Graphs

  • The Labyrinth (connected component size with DFS): C++
  • Dijkstra's single-source shortest-paths algorithm: Python

Sorting

Searching

  • Breadth-first search on a graph: Python
  • Depth-first search on a graph: Python
  • Binary search on an array: Python

Stacks and Queues

  • Implementation of a queue using two stacks: Python
  • Simple queue implementation: Python
  • Simple stack implementation: Python

Linked Lists

  • Linked list removal of node in middle of list: Python
  • Linked list duplicate node removal: Python
  • Linked list node implementation: Python

Strings

  • URL encode whitespace of string in-place: C++
  • C-string reverse: C++
  • String permutation check: Python
  • String rotation check: Python, C++
  • Simple string compress: Python, C++
  • String replace: Python

Miscellaneous

  • Codeforces Problem 1A ("Theatre Square"): C++
  • Data type size listing: C++
  • String concatenation benchmark: C++
  • FizzBuzz: C++
  • Standing ovation: Python
  • Vietnam snake: Python

Unit Tests

Python unit tests kept alongside target files in subdirectories, so to run all unit tests within a category:

cd target_directory
python -m unittest discover --pattern=test*.py

Code Formatting

I use the Google Python style guide to format my Python code, and pylint as a quick tool to check adherence to the formatting style.

Install pylint on Debian/Ubuntu and run it on Python source:

sudo apt-get install pylint
pylint source.py

About

Data structures and algorithms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published