Skip to content
Closed
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 algorithms/sort/cycle_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def cycle_sort(arr):
for cur in range(len_arr - 1):
item = arr[cur]

# Finding an indx to put items in.
# Finding an index to put items in.
index = cur
for i in range(cur + 1, len_arr):
if arr[i] < item:
Expand Down
2 changes: 1 addition & 1 deletion algorithms/streaming/misra_gries.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
By default, k is set to 2, solving the majority problem.

For the majority problem, this algorithm only guarantees that if there is
an element that appears more than n/2 times, it will be outputed. If there
an element that appears more than n/2 times, it will be outputted. If there
is no such element, any arbitrary element is returned by the algorithm.
Therefore, we need to iterate through again at the end. But since we have filtred
out the suspects, the memory complexity is significantly lower than
Expand Down
2 changes: 1 addition & 1 deletion algorithms/strings/delete_reoccurring.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
QUESTION: Given a string as your input, delete any reoccurring
character, and return the new string.

This is a Google warmup interview question that was asked duirng phone screening
This is a Google warmup interview question that was asked during phone screening
at my university.
"""

Expand Down
2 changes: 1 addition & 1 deletion algorithms/tree/same_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ def is_same_tree(tree_p, tree_q):
# where N and M are the number of nodes for the trees.

# Space Complexity O(min(height1, height2))
# levels of recursion is the mininum height between the two trees.
# levels of recursion is the minimum height between the two trees.