Skip to content
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

Corrected some spelling errors, and grammar mistakes. #205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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
12 changes: 6 additions & 6 deletions _i18n/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ pages:
description: "Merge sort is very predictable. It makes between <span class=\"code-inline\">0.5lg(n)</span> and <span class=\"code-inline\">lg(n)</span> comparisons per element, and between <span class=\"code-inline\">lg(n)</span> and <span class=\"code-inline\">1.5lg(n)</span> swaps per element. The minima are achieved for already sorted data; the maxima are achieved, on average, for random data. If using <span class=\"code-inline\">Θ(n)</span> extra space is of no concern, then merge sort is an excellent choice: It is simple to implement, and it is the only stable <span class=\"code-inline\">O(n·lg(n))</span> sorting algorithm. Note that when sorting linked lists, merge sort requires only <span class=\"code-inline\">Θ(lg(n)</span> extra space (for recursion). Merge sort is the algorithm of choice for a variety of situations: when stability is required, when sorting linked lists, and when random access is much more expensive than sequential access (for example, external sorting on tape). There do exist linear time in-place merge algorithms for the last step of the algorithm, but they are both expensive and complex. The complexity is justified for applications such as external sorting when <span class=\"code-inline\">Θ(n)</span> extra space is not available."
quick_sort:
title: "Quick sort"
description: "When carefully implemented, quicksort is robust and has low overhead. When a stable sort is not needed, quicksort is an excellent general-purpose sort – although the 3-way partitioning version should always be used instead. The 2-way partitioning code shown above is written for clarity rather than optimal performance; it exhibits poor locality, and, critically, exhibits <span class=\"code-inline\">O(n<sup>2</sup>)</span> time when there are few unique keys. A more efficient and robust 2-way partitioning method is given in Quicksort is Optimal by Robert Sedgewick and Jon Bentley. The robust partitioning produces balanced recursion when there are many values equal to the pivot, yielding probabilistic guarantees of <span class=\"code-inline\">O(n·lg(n))</span> time and <span class=\"code-inline\">O(lg(n))</span> space for all inputs. With both sub-sorts performed recursively, quick sort requires <span class=\"code-inline\">O(n)</span> extra space for the recursion stack in the worst case when recursion is not balanced. This is exceedingly unlikely to occur, but it can be avoided by sorting the smaller sub-array recursively first; the second sub-array sort is a tail recursive call, which may be done with iteration instead. With this optimization, the algorithm uses <span class=\"code-inline\">O(lg(n))</span> extra space in the worst case."
description: "When carefully implemented, quicksort is robust and has low overhead. When a stable sort is not needed, quicksort is an excellent general-purpose sort – although the 3-way partitioning version should always be used instead. The 2-way partitioning code shown above is written for clarity rather than optimal performance; it exhibits poor locality, and critically exhibits <span class=\"code-inline\">O(n<sup>2</sup>)</span> time when there are few unique keys. A more efficient and robust 2-way partitioning method is given in Quicksort by Robert Sedgewick and Jon Bentley. The robust partitioning produces balanced recursion when there are many values equal to the pivot, yielding probabilistic guarantees of <span class=\"code-inline\">O(n·lg(n))</span> time and <span class=\"code-inline\">O(lg(n))</span> space for all inputs. With both sub-sorts performed recursively, quick sort requires <span class=\"code-inline\">O(n)</span> extra space for the recursion stack in the worst case when recursion is not balanced. This is exceedingly unlikely to occur, but it can be avoided by sorting the smaller sub-array recursively first; the second sub-array sort is a tail recursive call, which may be done with iteration instead. With this optimization, the algorithm uses <span class=\"code-inline\">O(lg(n))</span> extra space in the worst case."
other: "Other sorting algorithms"
additional: "Additional reading"
searching:
Expand Down Expand Up @@ -215,8 +215,8 @@ pages:
description3: "Also has running time <span class=\"code-inline\">T_fetch + T_store</span>. To see why this should be the case, consider that the constant <span class=\"code-inline\">1</span> names a Fixnum object with value one. Therefore, we can expect the cost of fetching the reference to the object named 1 is the same as that of fetching a reference to any other object."
elementary_operations:
title: "Elementary arithmetic operations time"
description1: "The times required to perform elementary arithmetic operations, such as addition, subtraction, multiplication, division, and comparison, are all constants. These times are denoted by <span class=\"code-inline\">T_+, T_-, T_/, T_*, T_<,</span> respectively."
description2: "We can determine time of a statement like is <span class=\"code-inline\">2 * T_fetch + T_+ + T_store</span>. This is because we need to fetch two object references from the variables y and 1; perform the addition giving a new object whose value is the sum; and, store a reference to the new object in the variable y."
description1: "The time required to perform elementary arithmetic operations, such as addition, subtraction, multiplication, division, and comparison, are all constants. These times are denoted by <span class=\"code-inline\">T_+, T_-, T_/, T_*, T_<,</span> respectively."
description2: "We can determine the time of a statement like <span class=\"code-inline\">2 * T_fetch + T_+ + T_store</span>. This is because we need to fetch two object references from the variables y and 1; perform the addition giving a new object whose value is the sum; and, store a reference to the new object in the variable y."
description3: "We shall assume that the alternative requires exactly the same running time as the original statement."
call_method:
title: "Calling method time"
Expand All @@ -228,7 +228,7 @@ pages:
description2: "This is <span class=\"code-inline\">3 * T_fetch</span>. Three operand fetches are required: the first to fetch a reference to the array object a; the second to fetch a reference to the index object i; and, the third to fetch a reference to the array element <span class=\"code-inline\">a[i]</span>."
object:
title: "Object creation time"
description1: "The time required to create a new object instance of a class is a constant, <span class=\"code-inline\">T_new</span>. This time does not include any time taken to initialize the object. By applying Axioms we can determine that the running time of the statement."
description1: "The time required to create a new object instance of a class is a constant, <span class=\"code-inline\">T_new</span>. This time does not include any time taken to initialize the object. By applying Axioms we can determine the running time of the statement."
description2: "<span class=\"code-inline\">T_new + T_fetch + 2 * T_store + T_call + T_fixnum_init</span>, where <span class=\"code-inline\">T_fixnum_init</span> is the running time of the initialize method of the class Fixnum."
example:
title: "Example"
Expand Down Expand Up @@ -267,7 +267,7 @@ pages:
title: "Binary Tree"
description: "A binary tree is a tree in which each node can have a maximum of two children. The children are designated left and right."
binary_search_tree:
title: "Binary Search Tree<"
title: "Binary Search Tree"
description: "In computer science, binary search trees (BST), sometimes called ordered or sorted binary trees, are a particular type of containers: data structures that store \"items\" (such as numbers, names etc.) in memory. They allow fast lookup, addition and removal of items, and can be used to implement either dynamic sets of items, or lookup tables that allow finding an item by its key (e.g., finding the phone number of a person by name)"
b_tree:
title: "B-tree"
Expand Down Expand Up @@ -459,7 +459,7 @@ pages:
description: "Naked value becomes a temporary local variable! Solution: remember the <span class=\"code-inline\">@!</span> (Or \"self.\". Or use <span class=\"code-inline\">attr_writer, attr_accessor</span>.) Gets people from Java / C++, not so much Python (which needs \"self.\" too). \"You keep on using that variable. I don't think it means what you think it means.\". Not Inigo Montoya."
variables:
title: "Look out, it’s an @@!"
description: "Look what the filling the blank? We didn't change Parent’s <span class=\"code-inline\">@@value</span> before checking it, nor Child’s at all! Or did we? <span class=\"code-inline\">@@variables</span> are shared with subclasses - not just that they exist, but the variables themselves! Declaring Child’s <span class=\"code-inline\">@@value</span> changed Parent’s, and including Parent’s changed Child’s.ut, it’s an @@!"
description: "Look what’s filling the blank? We didn't change Parent’s <span class=\"code-inline\">@@value</span> before checking it, nor Child’s at all! Or did we? <span class=\"code-inline\">@@variables</span> are shared with subclasses - not just that they exist, but the variables themselves! Declaring Child’s <span class=\"code-inline\">@@value</span> changed Parent’s, and including Parent’s changed Child’s.ut, it’s an @@!"
initialize:
title: "With init(ialize) or without it"
description: "Parent's initialize runs automagically only if a child has none. Else, parent's must be called to run."
Expand Down