Skip to content

Commit c678829

Browse files
committed
corrected variable references and improved formatting
1 parent 722f975 commit c678829

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
correctly. Python's built-in "sorted" function is used to check the correctness of
1515
each implementation.
1616

17-
5. You may tweak the `length_of_string` and `length_of_string_list` global variables within
17+
5. You may tweak the `LENGTH_OF_STRING` and `LENGTH_OF_STRING_LIST` global variables within
1818
the main "parallel_vs_serial_sort.py" file to see how each sorting algorithm/function
1919
operates under various different parameters. The ONLY stipulations on each of those global
2020
variables' value is that each of them must be a non-negative integer.

parallel_quicksort.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@
1313
#
1414
########################################################
1515

16+
17+
## IMPORTS SECTION ##
18+
1619
# For parallelizing quicksort
1720
import multiprocessing
1821
# Personal implementation of serial partitioning and quicksort
1922
from serial_quicksort import serial_quicksort, partition
2023

24+
## END IMPORTS SECTION ##
25+
26+
27+
## BEGIN FUNCTIONS DECLARATIONS SECTION ##
28+
2129
# Parameter details:
2230
# - a_list: list to be sorted using parallel quicksort
2331
# - sending_socket: the end of the inter-processes communication pipe
@@ -139,5 +147,6 @@ def parallel_quicksort(a_list, sending_socket, current_processes_count,
139147
sending_socket.send(a_list)
140148
sending_socket.close()
141149

150+
## END FUNCTIONS DECLARATIONS SECTION ##
142151

143152

serial_quicksort.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
########################################################
1313

1414

15+
## BEGIN FUNCTIONS DECLARATIONS SECTION ##
16+
1517
# Parameter details:
1618
# - a_list: list to be sorted in ascending order
1719
# via serial quicksort; this function
@@ -51,7 +53,6 @@ def serial_quicksort(a_list):
5153
a_list.append(partitioning_element)
5254
a_list.extend(larger_than_list)
5355

54-
5556
# Parameter details:
5657
# - a_list: list to be partitioned into two parts: entries greater
5758
# than "partitioner" and entries less than "partitioner";
@@ -83,3 +84,6 @@ def partition(a_list, no_larger_than_list, larger_than_list, partitioner):
8384
else:
8485
no_larger_than_list.append(element)
8586

87+
## END FUNCTIONS DECLARATIONS SECTION ##
88+
89+

0 commit comments

Comments
 (0)