Skip to content

Commit 65f9a6d

Browse files
herinckcgoswami-rahul
authored andcommitted
refactored variable names (keon#340)
* fixed all relevant camelcase names I've seen up to 'graph' folder * fixed all instances of camelcase I noted up to 'linkedlist' folder * removed all noted camelcase up to queues folder * removed any camelcase I saw up through 'search' folder and changed 'occurance' to 'occurrence' * removed all noted camelcase up to 'trees' folder and changed 'dictionarys' to 'dictionaries' * removed all noted camelcase from 'algorithms' folder and made minor spelling changes throughout * changed setup back to setUp in relevent bst-related algos * fixed the missed curr_len in longest_abs_path.py
1 parent 5e08ff9 commit 65f9a6d

19 files changed

+62
-62
lines changed

algorithms/arrays/max_ones_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ def max_ones_index(arr):
4040
if n - prev_prev_zero > max_count:
4141
max_index = prev_zero
4242

43-
return max_index
43+
return max_index

algorithms/calculator/math_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,4 @@ def main():
144144

145145

146146
if __name__ == "__main__":
147-
main()
147+
main()

algorithms/dfs/sudoku_solver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,4 @@ def test_sudoku_solver(self):
107107

108108

109109
if __name__ == "__main__":
110-
unittest.main()
110+
unittest.main()

algorithms/dp/fib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ def fib_iter(n):
7070
return sum
7171

7272
# => 354224848179261915075
73-
# print(fib_iter(100))
73+
# print(fib_iter(100))
File renamed without changes.

algorithms/graph/pathBetweenTwoVerticesInDiGraph.py renamed to algorithms/graph/path_between_two_vertices_in_digraph.py

File renamed without changes.

algorithms/maths/base_conversion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import string
1010

11-
def int2base(n, base):
11+
def int_to_base(n, base):
1212
"""
1313
:type n: int
1414
:type base: int
@@ -31,7 +31,7 @@ def int2base(n, base):
3131
return res[::-1]
3232

3333

34-
def base2int(s, base):
34+
def base_to_int(s, base):
3535
"""
3636
Note : You can use int() built-in function instread of this.
3737
:type s: str

algorithms/search/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from .binary_search import *
2-
from .first_occurance import *
3-
from .last_occurance import *
2+
from .first_occurrence import *
3+
from .last_occurrence import *
44
from .linear_search import *
55
from .search_insert import *
66
from .two_sum import *
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Approach- Binary Search
44
# T(n)- O(log n)
55
#
6-
def first_occurance(array, query):
6+
def first_occurrence(array, query):
77
lo, hi = 0, len(array) - 1
88
while lo <= hi:
99
mid = (lo + hi) // 2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Approach- Binary Search
44
# T(n)- O(log n)
55
#
6-
def last_occurance(array, query):
6+
def last_occurrence(array, query):
77
lo, hi = 0, len(array) - 1
88
while lo <= hi:
99
mid = (hi + lo) // 2

0 commit comments

Comments
 (0)