From 5648d61a120842ea5974d89b601ade8d88151e9e Mon Sep 17 00:00:00 2001 From: NathanWaddell1211 Date: Tue, 1 Oct 2019 22:21:12 -0500 Subject: [PATCH] Corrected some spelling errors, and grammar mistakes. --- _i18n/en.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/_i18n/en.yml b/_i18n/en.yml index ef1ec3d..61ff09f 100644 --- a/_i18n/en.yml +++ b/_i18n/en.yml @@ -184,7 +184,7 @@ pages: description: "Merge sort is very predictable. It makes between 0.5lg(n) and lg(n) comparisons per element, and between lg(n) and 1.5lg(n) swaps per element. The minima are achieved for already sorted data; the maxima are achieved, on average, for random data. If using Θ(n) extra space is of no concern, then merge sort is an excellent choice: It is simple to implement, and it is the only stable O(n·lg(n)) sorting algorithm. Note that when sorting linked lists, merge sort requires only Θ(lg(n) 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 Θ(n) 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 O(n2) 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 O(n·lg(n)) time and O(lg(n)) space for all inputs. With both sub-sorts performed recursively, quick sort requires O(n) 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 O(lg(n)) 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 O(n2) 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 O(n·lg(n)) time and O(lg(n)) space for all inputs. With both sub-sorts performed recursively, quick sort requires O(n) 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 O(lg(n)) extra space in the worst case." other: "Other sorting algorithms" additional: "Additional reading" searching: @@ -215,8 +215,8 @@ pages: description3: "Also has running time T_fetch + T_store. To see why this should be the case, consider that the constant 1 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 T_+, T_-, T_/, T_*, T_<, respectively." - description2: "We can determine time of a statement like is 2 * T_fetch + T_+ + T_store. 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 T_+, T_-, T_/, T_*, T_<, respectively." + description2: "We can determine the time of a statement like 2 * T_fetch + T_+ + T_store. 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" @@ -228,7 +228,7 @@ pages: description2: "This is 3 * T_fetch. 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 a[i]." object: title: "Object creation time" - description1: "The time required to create a new object instance of a class is a constant, T_new. 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, T_new. 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: "T_new + T_fetch + 2 * T_store + T_call + T_fixnum_init, where T_fixnum_init is the running time of the initialize method of the class Fixnum." example: title: "Example" @@ -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" @@ -459,7 +459,7 @@ pages: description: "Naked value becomes a temporary local variable! Solution: remember the @! (Or \"self.\". Or use attr_writer, attr_accessor.) 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 @@value before checking it, nor Child’s at all! Or did we? @@variables are shared with subclasses - not just that they exist, but the variables themselves! Declaring Child’s @@value 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 @@value before checking it, nor Child’s at all! Or did we? @@variables are shared with subclasses - not just that they exist, but the variables themselves! Declaring Child’s @@value 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."