Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 54 Online
OpenStudy (anonymous):

okay, this should be pretty quick, what did ya'll get for the first few questions on the problem set 7 review?

OpenStudy (anonymous):

I got the first two as being linear O(i), number 3 was quadratic: O(s^2), and 4 was also quadratic O(s1^3 * s2^3) or if s1=s2, O(s^6)

OpenStudy (anonymous):

1.) Linear or O(n) because the recursion counts down 1 at a time 2.) Linear or O(n) because the while loop decrements by 1 each time. 3.) Linear because the for statement goes through exhaustive enumeration once. 4.) same as 4. O(n)

OpenStudy (anonymous):

edit: 4.) same as 3 (my bad)

OpenStudy (anonymous):

Wait really? 3 and 4 are linear? I thought that since (3) had nested functions (searching through the entire list 'res' for each element of the list 's'), that it would be quadratic. And since the complexity of (3) had to be taken into account when finding the complexity for (4), I thought that (4) definitely had to be quadratic.

OpenStudy (anonymous):

yes because problem 3 and 4 rely on the amount of n times and that is the maximum times we have to search for the solution. I could be wrong but i dont think so considering 7 out of the 8 people at http://curiousreef.com/class/mit-opencourseware-600-introduction/ have the same answer as me... The other person put linear, linear, linear, and exponential for #4

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
WalmartBag: can someone pls give me a proxy
7 minutes ago 1 Reply 0 Medals
Breathless: womp
1 hour ago 0 Replies 0 Medals
Breathless: yo who wanna match pfp?
1 hour ago 11 Replies 1 Medal
Ylynnaa: This was long time ago lmk if u fw itud83dude1d
5 hours ago 17 Replies 2 Medals
abound: Wow question cove really fell off
7 hours ago 6 Replies 1 Medal
ayden09: chat i love black pink hehe i like jones to
6 hours ago 20 Replies 2 Medals
kamani7676: help
1 day ago 5 Replies 1 Medal
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!