Skip to content

Commit

Permalink
Implement completely flat hierarchy (algorithm-archivists#268)
Browse files Browse the repository at this point in the history
* Implement a completely flat hierarchy. All readable contents of the AAA are now located in the "contents" folder (the README is the only exception).

* Fix the sizes of some titles.
  • Loading branch information
june128 authored Jul 19, 2018
1 parent bef36fa commit 2ec746b
Show file tree
Hide file tree
Showing 224 changed files with 84 additions and 84 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Unfortunately, this means that we will probably never cover every algorithm ever
That said, we'll still cover a few algorithms for fun that have very little, if any practical purpose.

If you would like to contribute, feel free to go to any chapter with code associated with it and implement that algorithm in your favorite language,
and then submit the code via pull request, following the submission guidelines found in `chapters/how_to_contribute.md` (or [here](chapters/introduction/how_to_contribute.md) if you are reading this on gitbook).
and then submit the code via pull request, following the submission guidelines found in `contents/how_to_contribute/how_to_contribute.md` (or [here](contents/how_to_contribute/how_to_contribute.md) if you are reading this on gitbook).

Hopefully, this project will grow and allow individuals to learn about and try their hand at implementing different algorithms for fun and (potentially) useful projects.
If nothing else, it will be an enjoyable adventure for our community.
Expand Down
70 changes: 35 additions & 35 deletions SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# Summary

* [Algorithm Archive](README.md)
* [Introduction](chapters/introduction/introduction.md)
* [How To Contribute](chapters/introduction/how_to_contribute.md)
* [Version Control](chapters/introduction/version_control.md)
* [Data Structures](chapters/data_structures/data_structures.md)
* [Stacks and Queues](chapters/data_structures/stacks_and_queues/stacks_and_queues.md)
* [Mathematical Background](chapters/general/mathematical_background/mathematical_background.md)
* [Complexity Notation](chapters/general/notation/notation.md)
* [Bit Logic](chapters/general/bitlogic/bitlogic.md)
* [Convolutions](chapters/algorithms/convolutions/convolutions.md)
* [Taylor Series](chapters/general/taylor_series_expansion/taylor_series_expansion.md)
* [Sorting and Searching](chapters/general/sorting_and_searching/sorting_and_searching.md)
* [Bubble Sort](chapters/algorithms/bubble_sort/bubble_sort.md)
* [Bogo Sort](chapters/algorithms/bogo_sort/bogo_sort.md)
* [Tree Traversal](chapters/algorithms/tree_traversal/tree_traversal.md)
* [Euclidean Algorithm](chapters/algorithms/euclidean_algorithm/euclidean_algorithm.md)
* [Monte Carlo](chapters/algorithms/monte_carlo_integration/monte_carlo_integration.md)
* [Matrix Methods](chapters/general/matrix_methods/matrix_methods.md)
* [Gaussian Elimination](chapters/algorithms/gaussian_elimination/gaussian_elimination.md)
* [Thomas Algorithm](chapters/algorithms/thomas_algorithm/thomas_algorithm.md)
* [Computational Geometry](chapters/general/computational_geometry/computational_geometry.md)
* [Gift Wrapping](chapters/general/gift_wrapping/gift_wrapping.md)
* [Jarvis March](chapters/algorithms/jarvis_march/jarvis_march.md)
* [Graham Scan](chapters/algorithms/graham_scan/graham_scan.md)
* [FFT](chapters/algorithms/cooley_tukey/cooley_tukey.md)
* [Decision Problems](chapters/general/decision_problems/decision_problems.md)
* [Stable Marriage Problem](chapters/algorithms/stable_marriage_problem/stable_marriage_problem.md)
* [Differential Equation Solvers](chapters/general/differential_equations/differential_equations.md)
* [Forward Euler Method](chapters/algorithms/forward_euler_method/forward_euler_method.md)
* [Physics Solvers](chapters/general/physics_solvers/physics_solvers.md)
* [Verlet Integration](chapters/algorithms/verlet_integration/verlet_integration.md)
* [Quantum Systems](chapters/general/quantum_systems/quantum_systems.md)
* [Split-Operator Method](chapters/algorithms/split-operator_method/split-operator_method.md)
* [Data Compression](chapters/general/data_compression/data_compression.md)
* [Huffman Encoding](chapters/algorithms/huffman_encoding/huffman_encoding.md)
* [Quantum Information](chapters/general/quantum_information/quantum_information.md)
* [Introduction](contents/introduction/introduction.md)
* [How To Contribute](contents/how_to_contribute/how_to_contribute.md)
* [Version Control](contents/git_and_version_control/git_and_version_control.md)
* [Data Structures](contents/data_structures/data_structures.md)
* [Stacks and Queues](contents/stacks_and_queues/stacks_and_queues.md)
* [Mathematical Background](contents/mathematical_background/mathematical_background.md)
* [Complexity Notation](contents/notation/notation.md)
* [Bit Logic](contents/bitlogic/bitlogic.md)
* [Convolutions](contents/convolutions/convolutions.md)
* [Taylor Series](contents/taylor_series_expansion/taylor_series_expansion.md)
* [Sorting and Searching](contents/sorting_and_searching/sorting_and_searching.md)
* [Bubble Sort](contents/bubble_sort/bubble_sort.md)
* [Bogo Sort](contents/bogo_sort/bogo_sort.md)
* [Tree Traversal](contents/tree_traversal/tree_traversal.md)
* [Euclidean Algorithm](contents/euclidean_algorithm/euclidean_algorithm.md)
* [Monte Carlo](contents/monte_carlo_integration/monte_carlo_integration.md)
* [Matrix Methods](contents/matrix_methods/matrix_methods.md)
* [Gaussian Elimination](contents/gaussian_elimination/gaussian_elimination.md)
* [Thomas Algorithm](contents/thomas_algorithm/thomas_algorithm.md)
* [Computational Geometry](contents/computational_geometry/computational_geometry.md)
* [Gift Wrapping](contents/gift_wrapping/gift_wrapping.md)
* [Jarvis March](contents/jarvis_march/jarvis_march.md)
* [Graham Scan](contents/graham_scan/graham_scan.md)
* [FFT](contents/cooley_tukey/cooley_tukey.md)
* [Decision Problems](contents/decision_problems/decision_problems.md)
* [Stable Marriage Problem](contents/stable_marriage_problem/stable_marriage_problem.md)
* [Differential Equation Solvers](contents/differential_equations/differential_equations.md)
* [Forward Euler Method](contents/forward_euler_method/forward_euler_method.md)
* [Physics Solvers](contents/physics_solvers/physics_solvers.md)
* [Verlet Integration](contents/verlet_integration/verlet_integration.md)
* [Quantum Systems](contents/quantum_systems/quantum_systems.md)
* [Split-Operator Method](contents/split-operator_method/split-operator_method.md)
* [Data Compression](contents/data_compression/data_compression.md)
* [Huffman Encoding](contents/huffman_encoding/huffman_encoding.md)
* [Quantum Information](contents/quantum_information/quantum_information.md)
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Choosing a Language
# Choosing a Language

I'm not going to beat around the bush here.
Every single time I try something new, I fail at it.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Compiled Languages
# Compiled Languages

Programming is hard because we need to write instructions for our computer.
The computer then reads this set of instructions and executes them accordingly.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ It would naively seem that better hardware means that there are less restriction

That said, there will always be new devices on the market that require minimizing data storage.
In fact, some of the most revolutionary algorithms and methods in existence today fall in the category of data compression.
From lossless data compression with [Huffman encoding](../../algorithms/huffman_encoding/huffman_encoding.md) to genetic compression algorithms and machine learning, there is a lot to learn about this field, and we'll go through it piece-by-piece.
From lossless data compression with [Huffman encoding](../huffman_encoding/huffman_encoding.md) to genetic compression algorithms and machine learning, there is a lot to learn about this field, and we'll go through it piece-by-piece.

All that said, no discussion about data compression is complete without first discussing the information, itself -- specifically how information is represented in computer systems.
Now, we've discussed this in some depth before with [bitlogic](../../principles_of_code/building_blocks/bitlogic.md), but there is much more to the story than what we let on before.
Expand Down Expand Up @@ -119,7 +119,7 @@ L_2 &= 0.1\times 3 + 0.2 \times 3 + 0.3 \times 2 + 0.4 \times 1 = 1.9
$$

Here, it's clear that $$L_2 < L_1$$, and thus the second set of codewords compresses our data more than the first.
This measure can be used as a direct test of certain simple data compression techniques, notably those created by Shannon, Fano, and [Huffman](../../algorithms/huffman_encoding/huffman_encoding.md), which will be covered soon!
This measure can be used as a direct test of certain simple data compression techniques, notably those created by Shannon, Fano, and [Huffman](../huffman_encoding/huffman_encoding.md), which will be covered soon!


<script>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
### FORTRAN
# FORTRAN

Alright, so here's the thing about Fortran. It's old.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The Euler methods are some of the simplest methods to solve ordinary differentia
They introduce a new set of methods called the Runge Kutta methods, which will be discussed in the near future!

As a physicist, I tend to understand things through methods that I have learned before.
In this case, it makes sense for me to see Euler methods as extensions of the [Taylor Series Expansion](../general/taylor_series_expansion/taylor_series_expansion.md).
In this case, it makes sense for me to see Euler methods as extensions of the [Taylor Series Expansion](../taylor_series_expansion/taylor_series_expansion.md).
These expansions basically approximate functions based on their derivatives, like so:

$$
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The *Algorithm Archive* is an effort to learn about and teach algorithms as a community.
As such, it requires a certain level of trust between community members.
For the most part, the collaboration can be done via GitHub and gitbook, so it is important to understand the basics of [version control](version_control.md).
For the most part, the collaboration can be done via GitHub and gitbook, so it is important to understand the basics of [version control](../git_and_version_control/git_and_version_control.md).
Ideally, all code provided by the community will be submitted via pull requests and discussed accordingly; however, I understand that many individuals are new to collaborative projects, so I will allow submissions by other means (comments, tweets, etc...).
As this project grows in size, it will be harder and harder to facilitate these submissions.
In addition, by submitting in any way other than pull requests, I cannot guarantee I will be able to list you as a collaborator (though I will certainly do my best to update the `CONTRIBUTORS.md` file accordingly).
Expand All @@ -23,7 +23,7 @@ We use two gitbook plugins to allow users to flip between languages on different
One is the theme-api, and the other is the include-codeblock api.
We need the following statements in the markdown file for these to work together:

[import](codeblock.txt)
[import](res/codeblock.txt)

For this example, we are starting the theme-api `method` and importing lines 1-17 from a sample Julia snippet from the code directory.
Note that to standardize the language capitalization schemes, we ask that each language's `sample lang` is the file extension for their code, `cpp` for C++, `hs` for Haskell, etc...
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ He managed to rip the heart out of the methods described by leaders of the field
It was in that moment, I knew I would never amount to anything.
I have since accepted that fact and moved on.

Huffman encoding follows from the problem described in the [Data Compression](../../general/data_compression/data_compression.md) section.
Huffman encoding follows from the problem described in the [Data Compression](../data_compression/data_compression.md) section.
We have a string that we want to encode into bits.
Huffman encoding ensures that our encoded bitstring is as small as possible without losing any information.
Because it is both lossless and guarantees the smallest possible bit length, it outright replaces both Shannon and Shannon-Fano encoding in most cases, which is a little weird because the method was devised while Huffman was taking a course from Fano, himself!
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ p = \frac{h}{\lambda}
$$

where $$h$$ is Planck's constant and $$\lambda$$ is the wavelength.
This means that we can ultimately move between real and momentum space by using [Fourier Transforms](../../algorithms/cooley_tukey/cooley_tukey.md), which is incredibly useful in a number of cases!
This means that we can ultimately move between real and momentum space by using [Fourier Transforms](../cooley_tukey/cooley_tukey.md), which is incredibly useful in a number of cases!

Unfortunately, the interpretation of quantum simulation is rather tricky and is ultimately easier to understand with slightly different notation.
This notation is called _braket_ notation, where a _ket_ looks like this:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $$
i \hbar \frac{\partial \Psi(\mathbf{r},t)}{\partial t} = \left[-\frac{\hbar^2}{2m}\nabla^2 + g|\Psi(\mathbf{r},t)|^2 \right] \Psi(\mathbf{r},t),
$$

which follows from the notation provided in the [quantum systems](../../general/quantum_systems/quantum_systems.md) chapter: $$\Psi(\mathbf{r},t)$$ is a quantum wave-function with spatial ($$\mathbf{r}$$) and time ($$t$$) dependence and $$\nabla^2$$ is a laplacian; however, in this case, we also add an interaction tern $$g$$ next to a nonlinear $$|\Psi(\mathbf{r},t)|^2$$ term.
which follows from the notation provided in the [quantum systems](../quantum_systems/quantum_systems.md) chapter: $$\Psi(\mathbf{r},t)$$ is a quantum wave-function with spatial ($$\mathbf{r}$$) and time ($$t$$) dependence and $$\nabla^2$$ is a laplacian; however, in this case, we also add an interaction tern $$g$$ next to a nonlinear $$|\Psi(\mathbf{r},t)|^2$$ term.
By adding in the $$V(\mathbf{r})$$ term, we get an equation used to study superfluid Bose--Einstein Condensate (BEC) systems:

$$
Expand All @@ -17,7 +17,7 @@ This is the system I studied for most of my PhD (granted, we played a few tricks

At it's heart, the split-op method is nothing more than a pseudo-spectral differential equation solver... That is to say, it solves the Schrodinger equation with [FFT's](../cooley_tukey/cooley_tukey.md).
In fact, there is a large class of spectral and pseudo-spectral methods used to solve a number of different physical systems, and we'll definitely be covering those in the future.
As mentioned in the [quantum systems](../../general/quantum_systems/quantum_systems.md) section, we can represent a a quantum wavefunction in momentum space, which is parameterized with the wavevector $$k$$.
As mentioned in the [quantum systems](../quantum_systems/quantum_systems.md) section, we can represent a a quantum wavefunction in momentum space, which is parameterized with the wavevector $$k$$.
In the hamiltonian shown above, we can split our system into real-space components, $$\hat{H}_R = \left[V(\mathbf{r}) + g|\Psi(\mathbf{r},t)|^2 \right] \Psi(\mathbf{r},t)$$, and momentum space components, $$\hat{H}_M = \left[-\frac{\hbar^2}{2m}\nabla^2 \right]\Psi(\mathbf{r},t)$$.
If we assume a somewhat general solution to our quantum system:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Stacks and Queues
# Stacks and Queues

Stacks and Queues are two sides of the same coin in computer science. They are both simple data structures that hold multiple elements, but allow you to use a single element at a time. The biggest difference between the two structures is the order in which you can access the elements in the data structure.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 2ec746b

Please sign in to comment.