This activity is an opportunity to assess the space and time complexity of pre-written code.
- We are not including a requirements.txt so there is no need to activate a venv, but you may if you so choose.
- Identify where the code starts running.
- Identify the code that has been commented out.
- Make sure you can run each scenario by adjusting the commented code.
- Make sure that for each scenario, you are able to run each sample input by adjusting the commented code.
- This is the sidewinder problem from the While Loops Problem Set. Please answer the following three questions in your group:
- What does this function do?
- What is the 0() of the time complexity? Why?
- What is the 0() of the space complexity? Why?
- Answer the following questions about
sum_digitsin your group:- What does this function do?
- What is the 0() of the time complexity? Why?
- What is the 0() of the space complexity? Why?
- Try adding similar counting code to that shown in sidewinder
- Answer the following questions about
most_common_entryin your group:- What does this function do?
- What is the 0() of the time complexity? Why?
- What is the 0() of the space complexity? Why?
When you have finished discussion all three functions, we will return to the main room to discuss an alternate solution to most_common_entry. Once completed, we will discuss the space and time complexity as a class.