diff --git a/content/2_Silver/4_Silver_BinSearch.md b/content/2_Silver/4_Silver_BinSearch.md index 3058e90..1440862 100644 --- a/content/2_Silver/4_Silver_BinSearch.md +++ b/content/2_Silver/4_Silver_BinSearch.md @@ -1,6 +1,6 @@ --- slug: /silver/binary-search -title: "Silver - Binary Search" +title: "Binary Search" author: Unknown order: 4 --- diff --git a/content/2_Silver/7_Silver_DFS.md b/content/2_Silver/7_Silver_DFS.md index 3cfb3b5..b431c72 100644 --- a/content/2_Silver/7_Silver_DFS.md +++ b/content/2_Silver/7_Silver_DFS.md @@ -5,25 +5,17 @@ author: Siyong Huang order: 7 --- - - - - ## Overview - - Prerequisites + - Introduction to Graphs - Depth First Search (DFS) - Flood Fill - Graph Two-Coloring - Cycle Detection -## Prerequisites + + +## Introduction to Graphs - [CSAcademy Graph Intro](https://csacademy.com/lesson/introduction_to_graphs) - [CSAcademy Graph Representations](https://csacademy.com/lesson/graph_representation) diff --git a/content/3_Gold/4_Gold_TopoSort.md b/content/3_Gold/4_Gold_TopoSort.md index fe9eb5e..d305b3a 100644 --- a/content/3_Gold/4_Gold_TopoSort.md +++ b/content/3_Gold/4_Gold_TopoSort.md @@ -5,13 +5,11 @@ author: Benjamin Qi order: 4 --- -
- Description: Todo -
+A [topological sort](https://en.wikipedia.org/wiki/Topological_sorting) of a directed graph is a linear ordering of its vertices such that for every directed edge $u\to v$ from vertex $u$ to vertex $v$, $u$ comes before $v$ in the ordering. -# Gold - [Topological Sort](https://en.wikipedia.org/wiki/Topological_sorting) + -Author: Benjamin Qi +## Example Problems - [CSES Course Schedule](https://cses.fi/problemset/task/1679) - [CSES Longest Flight Route](https://cses.fi/problemset/task/1680) @@ -21,6 +19,7 @@ Author: Benjamin Qi - CPH 16.1, 16.2 - [cp-algorithms](https://cp-algorithms.com/graph/topological-sort.html) + - ## Problems diff --git a/content/3_Gold/5_Gold_BIT.md b/content/3_Gold/5_Gold_BIT.md index 772597f..dc22e9b 100644 --- a/content/3_Gold/5_Gold_BIT.md +++ b/content/3_Gold/5_Gold_BIT.md @@ -5,31 +5,27 @@ author: Benjamin Qi order: 5 --- -
- Description: Todo -
- - - -## Prerequisites - Assumes that you are familiar with prefix sum queries (CPH 9.1). -## Task +Given an array of size $N$, perform the following tasks in $O(\log N)$ time each: -Given an array of size $N$, the task is to update the element at a single position (point) in addition to querying the sum of a prefix in $O(\log N)$ time each. + - Update the element at a single position (point). + - Querying the sum of a prefix of the array. -Sample Problems: +The easiest way to do this is with a **Binary Indexed Tree.** + + +## Binary Indexed Tree + +Probably the easiest way to do all of these tasks (aka **Fenwick Tree**). + +### Sample Problems * [CSES Range Sum Queries II](https://cses.fi/problemset/task/1648) * can also do range XOR queries w/ update * [SPOJ Inversion Counting](https://www.spoj.com/problems/INVCNT/) -## Binary Indexed Tree - -Probably the easiest way to do all of these tasks (aka Fenwick Tree). - -Tutorials: +### Tutorials * CPH 9.2 (very good) * [CSAcademy BIT](https://csacademy.com/lesson/fenwick_trees) (also very good)