From e1ec661d4e368ceabd50e7ef3714c85dbe139c02 Mon Sep 17 00:00:00 2001 From: Shuangchi He <34329208+Yulv-git@users.noreply.github.com> Date: Sun, 1 May 2022 18:44:23 +0800 Subject: [PATCH] Fix some typos (#6113) * Fix some typos. * Update volume.py Co-authored-by: John Law --- ciphers/shuffled_shift_cipher.py | 2 +- data_structures/stacks/dijkstras_two_stack_algorithm.py | 2 +- divide_and_conquer/inversions.py | 2 +- maths/volume.py | 4 ++-- strings/manacher.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ciphers/shuffled_shift_cipher.py b/ciphers/shuffled_shift_cipher.py index 3b84f97f6..714acd4b1 100644 --- a/ciphers/shuffled_shift_cipher.py +++ b/ciphers/shuffled_shift_cipher.py @@ -9,7 +9,7 @@ class ShuffledShiftCipher: This algorithm uses the Caesar Cipher algorithm but removes the option to use brute force to decrypt the message. - The passcode is a a random password from the selection buffer of + The passcode is a random password from the selection buffer of 1. uppercase letters of the English alphabet 2. lowercase letters of the English alphabet 3. digits from 0 to 9 diff --git a/data_structures/stacks/dijkstras_two_stack_algorithm.py b/data_structures/stacks/dijkstras_two_stack_algorithm.py index ba2ca92c7..976c9a53c 100644 --- a/data_structures/stacks/dijkstras_two_stack_algorithm.py +++ b/data_structures/stacks/dijkstras_two_stack_algorithm.py @@ -10,7 +10,7 @@ such as: (5 + ((4 * 2) * (2 + 3))) THESE ARE THE ALGORITHM'S RULES: RULE 1: Scan the expression from left to right. When an operand is encountered, - push it onto the the operand stack. + push it onto the operand stack. RULE 2: When an operator is encountered in the expression, push it onto the operator stack. diff --git a/divide_and_conquer/inversions.py b/divide_and_conquer/inversions.py index b47145602..e20d35dac 100644 --- a/divide_and_conquer/inversions.py +++ b/divide_and_conquer/inversions.py @@ -11,7 +11,7 @@ algorithm which runs in nlogn and the brute-force n^2 algorithm. def count_inversions_bf(arr): """ - Counts the number of inversions using a a naive brute-force algorithm + Counts the number of inversions using a naive brute-force algorithm Parameters ---------- arr: arr: array-like, the list containing the items for which the number diff --git a/maths/volume.py b/maths/volume.py index b11995bab..acaed65f4 100644 --- a/maths/volume.py +++ b/maths/volume.py @@ -38,8 +38,8 @@ def vol_spheres_intersect( Calculate the volume of the intersection of two spheres. The intersection is composed by two spherical caps and therefore its volume is the - sum of the volumes of the spherical caps. First it calculates the heights (h1, h2) - of the the spherical caps, then the two volumes and it returns the sum. + sum of the volumes of the spherical caps. First, it calculates the heights (h1, h2) + of the spherical caps, then the two volumes and it returns the sum. The height formulas are h1 = (radius_1 - radius_2 + centers_distance) * (radius_1 + radius_2 - centers_distance) diff --git a/strings/manacher.py b/strings/manacher.py index e6ea71cde..c58c7c19e 100644 --- a/strings/manacher.py +++ b/strings/manacher.py @@ -88,7 +88,7 @@ iv) a1 is corresponding equal character of a5 in palindrome with center a3 (reme now for a5 we will calculate the length of palindromic substring with center as a5 but can we use previously calculated information in some way? Yes, look the above string we know that a5 is inside the palindrome with center a3 and -previously we have have calculated that +previously we have calculated that a0==a2 (palindrome of center a1) a2==a4 (palindrome of center a3) a0==a6 (palindrome of center a3)