From e5ad6ec9e7c91abd071aa1dea4b0d507b705aee6 Mon Sep 17 00:00:00 2001 From: Tim Gates Date: Sat, 2 Jul 2022 18:55:02 +1000 Subject: [PATCH] docs: Fix a few typos There are small typos in: - data_structures/array/all_numbers_divisible.py - data_structures/array/index.md - data_structures/binary_trees/children_sum_property.py - data_structures/graphs/cycle_in_directed_graph_using_colors.py - data_structures/graphs/cycle_in_directed_graph_using_colors_recursive.py - data_structures/graphs/dag_longest_path.py - data_structures/heap/max_heap.py - data_structures/strings/KMP_Pattern_Search.py Fixes: - Should read `initial` rather than `inital`. - Should read `equal` rather than `eqaul`. - Should read `satisfies` rather than `statisfies`. - Should read `divisible` rather than `divisble`. - Should read `comparison` rather than `comparision`. - Should read `children` rather than `childen`. - Should read `calculate` rather than `caluclate`. --- data_structures/array/all_numbers_divisible.py | 2 +- data_structures/array/index.md | 4 ++-- data_structures/binary_trees/children_sum_property.py | 2 +- .../graphs/cycle_in_directed_graph_using_colors.py | 2 +- .../graphs/cycle_in_directed_graph_using_colors_recursive.py | 2 +- data_structures/graphs/dag_longest_path.py | 2 +- data_structures/heap/max_heap.py | 2 +- data_structures/strings/KMP_Pattern_Search.py | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/data_structures/array/all_numbers_divisible.py b/data_structures/array/all_numbers_divisible.py index 26eaaabd..e77fe135 100644 --- a/data_structures/array/all_numbers_divisible.py +++ b/data_structures/array/all_numbers_divisible.py @@ -2,7 +2,7 @@ # in the array are divisible by it # A - just find the min in the array and check if all the other elements -# are divisble by it +# are divisible by it import sys diff --git a/data_structures/array/index.md b/data_structures/array/index.md index c549554c..e5b01ba2 100644 --- a/data_structures/array/index.md +++ b/data_structures/array/index.md @@ -44,7 +44,7 @@ output=[2,3] Find three largest numbers from an array * [Triplet Sum](triplet_sum.py) -Find three elements of an array whose sum is eqaul to a given value +Find three elements of an array whose sum is equal to a given value * [Moves to Zero](moves_zeros_to_end.py) @@ -74,7 +74,7 @@ For a given array return an array that contains square of elements. Find an element in an array which has most occurences * [Find Sum](find_sum.py) -Find if sum of any elements in array is eqaul to a given number +Find if sum of any elements in array is equal to a given number * [Quick Sort](quick_sort.py) ### Implement Quick Sort algorithm diff --git a/data_structures/binary_trees/children_sum_property.py b/data_structures/binary_trees/children_sum_property.py index 8894fabe..6a192788 100644 --- a/data_structures/binary_trees/children_sum_property.py +++ b/data_structures/binary_trees/children_sum_property.py @@ -1,4 +1,4 @@ -# Check whether a tree statisfies children sum property +# Check whether a tree satisfies children sum property # Children sum property is such that every partent = left + right child class Node: diff --git a/data_structures/graphs/cycle_in_directed_graph_using_colors.py b/data_structures/graphs/cycle_in_directed_graph_using_colors.py index 44dfb5ac..8008e5a1 100644 --- a/data_structures/graphs/cycle_in_directed_graph_using_colors.py +++ b/data_structures/graphs/cycle_in_directed_graph_using_colors.py @@ -1,6 +1,6 @@ """ Using three colors - white, gray and black -White - vertices that are not processed (inital state of all vertices) +White - vertices that are not processed (initial state of all vertices) Gray - vertices that are in DFS Black - fully traversed vertices (i.e its progenies are also done) diff --git a/data_structures/graphs/cycle_in_directed_graph_using_colors_recursive.py b/data_structures/graphs/cycle_in_directed_graph_using_colors_recursive.py index c4a687ed..af1d3ded 100644 --- a/data_structures/graphs/cycle_in_directed_graph_using_colors_recursive.py +++ b/data_structures/graphs/cycle_in_directed_graph_using_colors_recursive.py @@ -1,6 +1,6 @@ """ Using three colors - white, gray and black -White - vertices that are not processed (inital state of all vertices) +White - vertices that are not processed (initial state of all vertices) Gray - vertices that are in DFS Black - fully traversed vertices (i.e its progenies are also done) diff --git a/data_structures/graphs/dag_longest_path.py b/data_structures/graphs/dag_longest_path.py index 796c43da..31658d53 100644 --- a/data_structures/graphs/dag_longest_path.py +++ b/data_structures/graphs/dag_longest_path.py @@ -1,5 +1,5 @@ """ -The idea is similar to DAG Shortest Path. Only the comparision part changes +The idea is similar to DAG Shortest Path. Only the comparison part changes """ from collections import defaultdict diff --git a/data_structures/heap/max_heap.py b/data_structures/heap/max_heap.py index 29fcef70..52a2401b 100644 --- a/data_structures/heap/max_heap.py +++ b/data_structures/heap/max_heap.py @@ -78,7 +78,7 @@ def insert(self, value): def max_heapify(self, pos): """ This function will run whenever a node is non-leaf - node and smaller than its childen + node and smaller than its children """ if not self.is_leaf(pos): left = self.heap[self.left_child(pos)] diff --git a/data_structures/strings/KMP_Pattern_Search.py b/data_structures/strings/KMP_Pattern_Search.py index 37bfcd2c..dd7947b6 100644 --- a/data_structures/strings/KMP_Pattern_Search.py +++ b/data_structures/strings/KMP_Pattern_Search.py @@ -10,7 +10,7 @@ def KMP_pattern_search(pattern, text): # index for pattern[] j=0 - # preprocess the pattern (caluclate long_prefix_suffix[] array) + # preprocess the pattern (calculate long_prefix_suffix[] array) long_Prefix_Suffix_Array(pattern, P, long_prefix_suffix) # index for text[]