Skip to content

Commit f46e72e

Browse files
committed
Updated to conform black's styling.
1 parent 92167dc commit f46e72e

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

src/python/counting_sort.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
def counting_sort(arr):
7-
""" Finding the max element in the list """
7+
"""Finding the max element in the list"""
88
k = max(arr) + 1
99

1010
""" Initialing count array of len k with 0's """

src/python/doubly_linked_list.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, data, prev, next):
2121
class DoublyLinkedList:
2222
head = None
2323
tail = None
24-
24+
2525
def append(self, data):
2626
# Creates a new node pointing to None (prev and next)
2727
new_node = Node(data, None, None)
@@ -34,13 +34,12 @@ def append(self, data):
3434
# For a non-empty list, adjust pointers to add the new node at the end
3535
new_node.prev = self.tail # New node's prev points to the current tail
3636
self.tail.next = new_node # Current tail's next points to the new node
37-
self.tail = new_node # Update tail to be the new node
37+
self.tail = new_node # Update tail to be the new node
3838

3939
# No additional 'new_node.next = None' is needed as it's already None by default
4040

41-
4241
def delete(self, data):
43-
""" Deletes a node from the list """
42+
"""Deletes a node from the list"""
4443
""" Current node is first node in the list"""
4544
curr_node = self.head
4645

@@ -71,7 +70,7 @@ def delete(self, data):
7170
curr_node = curr_node.next
7271

7372
def display(self):
74-
""" Displays all data in the list"""
73+
"""Displays all data in the list"""
7574
print("Doubly Linked List: ")
7675

7776
# Current node is head of the list

src/python/fibonacci_recursive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def fibonacci(number):
1212
"""
1313
Recursive Fibonacci
1414
"""
15-
15+
1616
if number < 2:
1717
return number
1818
return fibonacci(number - 1) + fibonacci(number - 2)

src/python/insertion_sort.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def insertion_sort_recursive(vector, index):
5757
list2 = [8, 1, 3, 5, 7, 9, 0, 2, 4, 6]
5858
print("Unsorted list: ")
5959
print(list2)
60-
60+
6161
list2 = insertion_sort_recursive(list2, 1)
6262
print("Sorted list with recursive insertion sort: ")
6363
print(list2)

src/python/quick_sort.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33

44
def swap(a_list, pos1, pos2):
5-
""" Swaps the position of two items in a list """
5+
"""Swaps the position of two items in a list"""
66
temp = a_list[pos1]
77
a_list[pos1] = a_list[pos2]
88
a_list[pos2] = temp
99

1010

1111
def partition(a_list, start, end):
12-
""" Splits a list """
12+
"""Splits a list"""
1313
pivot = a_list[start]
1414
while True:
1515
while a_list[start] < pivot:
@@ -28,7 +28,7 @@ def partition(a_list, start, end):
2828

2929

3030
def quick_sort(a_list, start, end):
31-
""" Quick sort algorithm """
31+
"""Quick sort algorithm"""
3232
if start < end:
3333
part = partition(a_list, start, end)
3434
quick_sort(a_list, start, part)

0 commit comments

Comments
 (0)