Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion data_structures/array/all_numbers_divisible.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions data_structures/array/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion data_structures/binary_trees/children_sum_property.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
2 changes: 1 addition & 1 deletion data_structures/graphs/dag_longest_path.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion data_structures/heap/max_heap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion data_structures/strings/KMP_Pattern_Search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down