Exercise 1 In[21]: def f1 ( lst ): r = 0 n = 100 if len ( lst ) < n: n = len(lst) for x in range ( n ): r + = x Read Only Hypothesis:f1= O(?
Question Get Answer

Exercise 1<br/>In [21]:<br/><br/><br/><br/><br/><br/><br/>def f1(lst):

r = 0 n = 100 if len(lst) &lt; n: n = len(lst) for x in range(n): r += x Read Only
Hypothesis: f1 = O(?) ← fill in your hypothesis here
In [22]:






# collect timing data into arrays/lists here ns = [] ts = [] Graded


Starter Code
In [ ]:




# plot your data and bounding functions here plt.plot(ns, ts, 'or') plt.plot(ns, [], '-g') plt.plot(ns, [], '-b'); Graded


Starter Code
Exercise 2
In [ ]:




def f2(x): r = x / 2 d = 1e-10 while abs(x - r**2) &gt; d: r = (r + x/r) / 2 return r Read Only
Hypothesis: f2 = O(?) ← fill in your hypothesis here
In [ ]:




# collect timing data into arrays/lists here ns = [] ts = [] Graded


Starter Code
In [ ]:




# plot your data and bounding functions here plt.plot(ns, ts, 'or') plt.plot(ns, [], '-g') plt.plot(ns, [], '-b');

Exercise 2 ONLY!!!

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Let our 24/7 Python Programming tutors help you get unstuck! Ask your first question.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes