From 1da4a16ec81279a4b92b3a38a7e4ae52bc91ede8 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 19 Jan 2024 17:21:42 +0000 Subject: [PATCH] add some notes --- chapter10/README.md | 3 +++ chapter11/README.md | 6 ++++++ chapter12/README.md | 9 +++++++++ chapter4/binary.py | 1 - chapter9/README.md | 5 +++++ 5 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 chapter10/README.md create mode 100644 chapter11/README.md create mode 100644 chapter12/README.md create mode 100644 chapter9/README.md diff --git a/chapter10/README.md b/chapter10/README.md new file mode 100644 index 0000000..ec8632b --- /dev/null +++ b/chapter10/README.md @@ -0,0 +1,3 @@ +# Approximation algorithm + +- Easy to write, fast to run, useful for obtaining approximate solutions for NP-hard problems. diff --git a/chapter11/README.md b/chapter11/README.md new file mode 100644 index 0000000..d348b66 --- /dev/null +++ b/chapter11/README.md @@ -0,0 +1,6 @@ +# Dynamic Programming + +A programming technique for decomposing a problem into smaller discrete subproblems. + +- Useful when trying to optimize something given a constraint. + - Example, items in a knapsack of size W that gives the greates value. diff --git a/chapter12/README.md b/chapter12/README.md new file mode 100644 index 0000000..e94123f --- /dev/null +++ b/chapter12/README.md @@ -0,0 +1,9 @@ +# K-Nearest Neighbours + +Useful for classification, regression and feature extraction. By examining a data point against its K nearest neighbours we can: + +- categorize into a group +- predict responses +- convert the item into a list of features + +A good starting point for machine learning. diff --git a/chapter4/binary.py b/chapter4/binary.py index 9382bcc..a16a86a 100644 --- a/chapter4/binary.py +++ b/chapter4/binary.py @@ -1,6 +1,5 @@ import logging import random -import time logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger(__name__) diff --git a/chapter9/README.md b/chapter9/README.md new file mode 100644 index 0000000..cca7401 --- /dev/null +++ b/chapter9/README.md @@ -0,0 +1,5 @@ +# Shortest path for weighted graph (cost associated edges) + +- Dijkstra's algorithm works when all weights are non-negative + - If there are negative weights use Bellman-Ford. +- Priority queue + min heap is optimal when compared to a function that operates on a list.