Repo containing various algorithmic problems solutions and data structures implementations
Directories in the src
split by topic/course/etc.:
└── src
├── algorithms
├── common
└── cses
└── ...
Each directory may contain multiple folders with implementations in different languages.
The common
folder should contain some generic functionality that could be reused across the code, like reading from stdin
or file.
For mac-os users:
Since mac-os uses clang
(which is good for the "real" development, btw) by default and here I sometimes use bits/stdc++.h
header, you'll need to install gcc
for using that header:
brew install gcc
The command to compile looks like this (the same as for most competitive programming platforms):
g++ -lm -O2 -fno-stack-limit -std=c++1z -x c++ <code> -o <executable>
clang
and "newer" C++:
clang++ --std=c++20 -O3 -fsanitize=address,undefined -Wall -Wextra -Werror <code> -o <executable>
Running with test examples:
./my_object_file < test.txt
I've used python3.8
. You can install and activate any version via pyenv.
To run the code, you can just call:
python3 <file>
Or compile the bytecode first like that:
py_compile.compile(<file>, doraise=True)
Run tests:
go test -v -race <file>