File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,8 +104,8 @@ def benchmark() -> None:
104104 Benchmark comparing topological_sort() (using deque.popleft) against
105105 the pre-optimization baseline _topological_sort_list_queue() (using list.pop(0)).
106106
107- Demonstrates the performance improvement of O(1) queue operations in Kahn's algorithm
108- on a graph with a large number of zero-indegree vertices.
107+ Demonstrates the performance improvement of O(1) queue operations in
108+ Kahn's algorithm on a graph with a large number of zero-indegree vertices.
109109 """
110110 from timeit import timeit
111111
@@ -125,7 +125,8 @@ def benchmark() -> None:
125125 new_time = timeit (lambda : topological_sort (graph ), number = runs )
126126
127127 print (
128- f"Benchmark results for topological_sort with { num_sources } vertices over { runs } runs:"
128+ f"Benchmark results for topological_sort with { num_sources } vertices "
129+ f"over { runs } runs:"
129130 )
130131 print (f"Pre-optimization (list.pop(0)): { old_time :.5f} seconds" )
131132 print (f"Current (deque.popleft): { new_time :.5f} seconds" )
You can’t perform that action at this time.
0 commit comments