Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 14 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
Countless7Echos: ik i'm late but finished ToT added some details :p
3 hours ago 2 Replies 0 Medals
Grimson: What's your new years resolution.
8 hours ago 1 Reply 1 Medal
LemmyluvsGelo: Why be sad when you could js be Gone . ud83dudd7a
7 hours ago 4 Replies 1 Medal
Ferrari: anyone have insta??
3 hours ago 23 Replies 3 Medals
xXAikoXx: I made art
12 hours ago 6 Replies 3 Medals
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!