Skip to content

Ada-Activities/Big_O_Activity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Big_O_Activity

This activity is an opportunity to assess the space and time complexity of pre-written code.

Step 0: Fork and Clone this Repo

  • The requirements.txt for this activity is empty, so it's not strictly required to set up a virtual environment, but feel free to do so.

Step 1: Play around with the Code

  • 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.

Step 2: Assess Sidewinder

  • 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?

Step 3: Assess Sum Digits

  • Answer the following questions about sum_digits 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?
    • Try adding similar counting code to that shown in sidewinder

Step 4: Assess Most Common Entry

  • Answer the following questions about most_common_entry 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?

Step 5: Refactoring Most Common Entry (Live Code)

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages