Skip to content

Commit 87c8641

Browse files
committed
Cleanup; removing lots of old stuff
1 parent 03beeb0 commit 87c8641

File tree

75 files changed

+110
-2199
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+110
-2199
lines changed

Dockerfile

Lines changed: 0 additions & 28 deletions
This file was deleted.

Makefile

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,41 @@
1-
##############################################################
2-
### Dockerized Linux workspace for consistent environment. ###
3-
### Everything in this repo is supported only within the ###
4-
### container environment ###
5-
##############################################################
6-
include tools/makefiles/settings.mk
7-
8-
# Remove existing containers
9-
docker-clean:
10-
-docker stop $(CONTAINER_NAME)
11-
-docker rm $(CONTAINER_NAME)
12-
13-
# Build image from Dockerfile
14-
image:
15-
-docker pull ubuntu
16-
docker build . -t $(CONTAINER_NAME)
17-
18-
# Start running container from built image
19-
docker:
20-
docker run \
21-
-dt \
22-
--privileged \
23-
--name $(CONTAINER_NAME) \
24-
-v `pwd`:/$(CONTAINER_NAME) \
25-
$(CONTAINER_NAME)
26-
27-
# Create running shell session inside container
28-
shell:
29-
docker exec -it $(CONTAINER_NAME) /bin/bash
30-
31-
# All-in-one command to build and start workspace.
32-
workspace: docker-clean image docker shell
33-
34-
venv:
35-
-rm -r algorithms
36-
python3 -m venv ./algorithms
37-
source algorithms/bin/activate; pip3 install requirements.txt
1+
VENV:=venv/algos
2+
BUILD_DIR:=bin/
383

4+
### Uncomment this to run Clang's static analyzer while building; this makes the build slower.
5+
ANALYZER:=scan-build --status-bugs
6+
7+
### Valgrind target for memory analysis
8+
VALGRIND := valgrind -q --leak-check=full --show-leak-kinds=all --track-origins=yes --error-exitcode=42
9+
10+
### C compilation flags
11+
C_COMPILER:=clang
12+
C_FLAGS :=-std=gnu11 -g -lm -pthread
13+
C_WARNINGS :=-Weverything -Werror
14+
C_COMPILE:=$(ANALYZER) $(CC) $(CFLAGS) $(WARNINGS) $(EXTRA_FLAGS)
15+
16+
### C++ compilation flags for different scenarios
17+
CC_QUALITY_COMPILER:=clang++
18+
CC_QUALITY_FLAGS :=-std=c++17 -g -lm -Wno-c++98-compat -fstandalone-debug
19+
CC_QUALITY_WARNINGS :=-Weverything -Werror
20+
CC_QUALITY_COMPILE:= $(CC_QUALITY_COMPILER) $(CC_QUALITY_FLAGS) $(CC_QUALITY_WARNINGS)
21+
22+
CC_CONTEST_COMPILER:=g++
23+
CC_CONTEST_FLAGS :=-std=c++11 -O2
24+
CC_CONTEST_WARNINGS :=-Wall -Wno-c++98-compat
25+
CONTEST_COMPILE:= $(CC_CONTEST_COMPILER) $(CC_CONTEST_FLAGS) $(CC_CONTEST_WARNINGS)
26+
27+
install:
28+
-rm -r $(VENV)
29+
python3 -m venv ./$(VENV)
30+
source $(VENV)/bin/activate; pip3 install requirements.txt
31+
32+
# Run this with $sudo
33+
sudo-install:
34+
apt-get install clang valgrind
35+
36+
notebooks:
37+
source $(VENV)/bin/activate; jupyter-notebook
38+
39+
clean:
40+
-rm -r $(BUILD_DR)
41+
-mkdir $(BUILD_DIR)

README.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
# algorithms
22

3-
Algorithms / data structures implemented for practice, as well as solutions to all of my programming competition and mock interview questions.
3+
Programming problems, plus my notes on algorithms, data structures, and programming techniques.
44

55
## Contents
66

7-
- [algos](algos/) - Algorithms and data structures implemented for practice / training (mostly from Skiena's _Algorithm Design Manual_, Wikipedia, or research papers)
7+
- [notebooks](notebooks/) - Jupyter notebooks with explanations of various data structures, algorithms, and techniques
88
- [leetcode](leetcode/) - All of my LeetCode problems / solutions
9+
- [patterns](patterns/) - Various software design patterns
910
- [misc](misc/) - Questions mock interviews, friendly challenges, or other competition sites where I only did a few problems.
1011

11-
## Building
12-
13-
To actually run code in this repo, I use:
14-
15-
- The Dockerized workspace that is automated via the top-level Makefile
16-
- The Makefile system (see below for docs)
17-
18-
## Docs
19-
20-
This repo contains the following docs:
21-
22-
- [SUPER.md](docs/SUPER.md): a modified form of [Polya's problem solving method](https://math.berkeley.edu/~gmelvin/polya.pdf) that I use for programming problems
23-
- [learning-dp.md](docs/learning-dp.md): some general advice for mastering dynamic programming
24-
- [unix-philosophy.md](docs/unix-philosophy.md): a reproduction of Eric S. Raymond's "Unix Philosophy"
25-
- [make-system.md](docs/make-system.md): documentation for this repo's Makefile system
12+
## Running
13+
```
14+
make install notebooks
15+
```
16+
17+
## Recommended Reading, References, and Resources
18+
- __[The Algorithm Design Manual](https://www.amazon.com/Algorithm-Design-Manual-Computer-Science/dp/3030542556)__
19+
- __[Intro to Algorithms, 3rd Ed.](https://www.amazon.com/Introduction-Algorithms-3rd-MIT-Press/dp/0262033844)__
20+
- __[Head First Design Patterns](https://www.amazon.com/Head-First-Design-Patterns-Brain-Friendly/dp/0596007124)__
21+
- __[Daily Coding Problem](https://www.amazon.com/Daily-Coding-Problem-exceptionally-interviews/dp/1793296634)__
22+
- __[Elements of Programming Interviews](https://www.amazon.com/Elements-Programming-Interviews-Python-Insiders/dp/1537713949)__ ([C++ version](https://www.amazon.com/Elements-Programming-Interviews-Insiders-Guide/dp/1479274836))
23+
- Leetcode solutions and writeups from [@lee215](https://leetcode.com/lee215/) and [@StefanPochmann](https://leetcode.com/StefanPochmann/)
24+
- [Problem Solving with Algorithms and Data Structures](https://bradfieldcs.com/courses/algorithms/) at Bradfield School of Computer Science

docs/SUPER.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/learning-dp.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

docs/make-system.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

implementations/Makefile

Lines changed: 0 additions & 5 deletions
This file was deleted.

implementations/README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

implementations/__init__.py

Whitespace-only changes.

implementations/dynamic_programming/binomial_coefficients.py

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)