Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Hotfix/sorting #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
amejiarosario merged 3 commits into master from hotfix/sorting
May 26, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore(book/sorting): fix bubble sort reference
  • Loading branch information
amejiarosario committed May 26, 2020
commit f3fe049b266c015145eaf33cc913e9a4ea4032c9
1 change: 1 addition & 0 deletions book/content/part04/bubble-sort.asc
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ifndef::imagesdir[]
:codedir: ../../../src
endif::[]

[[bubble-sort]]
==== Bubble Sort
(((Bubble Sort)))
(((Sorting, Bubble Sort)))
Expand Down
4 changes: 2 additions & 2 deletions book/content/part04/quick-sort.asc
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ With the optimization, Quicksort has an _O(n log n)_ running time. Similar to th
- <<Online>>: [big]#️❌# No, the pivot element can be choose at random.
- Recursive: Yes
- Time Complexity: [big]#✅# <<part01-algorithms-analysis#linearithmic>> _O(n log n)_
- Space Complexity: [big]#✅# <<part01-algorithms-analysis#constant>> _O(1)_
- Space Complexity: [big]#✅# <<part01-algorithms-analysis#logarithmic>> _O(log n)_, because of recursion.

(((Linearithmic)))
(((Runtime, Linearithmic)))
(((Space complexity, Constant)))
(((Space complexity, Logarithmic)))

// Resources:
// https://www.khanacademy.org/computing/computer-science/algorithms/quick-sort/a/linear-time-partitioning
Expand Down
8 changes: 4 additions & 4 deletions book/content/part04/sorting-algorithms.asc
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Sorting is one of the most common solutions when we want to extract some insight
We can sort to get the maximum or minimum value and many algorithmic problems involves sorting data first.

.We are going to explore three basic sorting algorithms _O(n^2^)_ which have low overhead:
- <<part04-algorithmic-toolbox#insertion-sort>>
- <<part04-algorithmic-toolbox#bubble-sort>>
- <<part04-algorithmic-toolbox#selection-sort>>
- <<part04-algorithmic-toolbox#insertion-sort>>

Expand Down Expand Up @@ -120,7 +120,7 @@ We explored many algorithms some of them simple and other more performant. Also,
[cols="20,80"]
|===
| Algorithms | Comments
| <<part04-algorithmic-toolbox#insertion-sort>> | Swap pairs bubbling up largest numbers to the right
| <<part04-algorithmic-toolbox#bubble-sort>> | Swap pairs bubbling up largest numbers to the right
| <<part04-algorithmic-toolbox#insertion-sort>> | Look for biggest number to the left and swap it with current
| <<part04-algorithmic-toolbox#selection-sort>> | Iterate array looking for smallest value to the right
| <<part04-algorithmic-toolbox#merge-sort>> | Split numbers in pairs, sort pairs and join them in ascending order
Expand All @@ -131,11 +131,11 @@ We explored many algorithms some of them simple and other more performant. Also,
.Sorting algorithms time/space complexity and properties
|===
| Algorithms | Avg | Best | Worst | Space | Stable | In-place | Online | Adaptive
| <<part04-algorithmic-toolbox#insertion-sort>> | O(n^2^) | O(n) | O(n^2^) | O(1) | Yes | Yes | Yes | Yes
| <<part04-algorithmic-toolbox#bubble-sort>> | O(n^2^) | O(n) | O(n^2^) | O(1) | Yes | Yes | Yes | Yes
| <<part04-algorithmic-toolbox#insertion-sort>> | O(n^2^) | O(n) | O(n^2^) | O(1) | Yes | Yes | Yes | Yes
| <<part04-algorithmic-toolbox#selection-sort>> | O(n^2^) | O(n^2^) | O(n^2^) | O(1) | No | Yes | No | No
| <<part04-algorithmic-toolbox#merge-sort>> | O(n log n) | O(n log n) | O(n log n) | O(n) | Yes | No | No | No
| <<part04-algorithmic-toolbox#quicksort>> | O(n log n) | O(n log n) | O(n^2^) | O(log n) | No | Yes | No | No
| <<part04-algorithmic-toolbox#quicksort>> | O(n log n) | O(n log n) | O(n^2^) | O(log n) | No | Yes | No | No
// | Tim sort | O(n log n) | O(log n) | Yes | No | No | Yes
|===
// end::table[]

AltStyle によって変換されたページ (->オリジナル) /