Add your answers to the questions below.
-
What is the runtime complexity of your
depth_first_for_eachmethod? O(n) -
What is the space complexity of your
depth_first_for_eachfunction? O(n) -
What is the runtime complexity of your
breadth_first_for_eachmethod? O(n) -
What is the space complexity of your
breadth_first_for_eachmethod? O(n) -
What is the runtime complexity of the provided code in
names.py? O(n^2) -
What is the space complexity of the provided code in
names.py? O(n) -
What is the runtime complexity of your optimized code in
names.py? O(n) -
What is the space complexity of your optimized code in
names.py? O(n)