Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 33 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
Lilmunchin: Trump or Biden
2 minutes ago 17 Replies 1 Medal
ARTSMART: Art!
50 minutes ago 5 Replies 4 Medals
Jasonisyours: What were the key causes of the French Revolution in 1789?
44 minutes ago 3 Replies 5 Medals
PureSoulless: Why is the word "Pedophile" always censored in yt vids?
1 day ago 3 Replies 0 Medals
Jalli: What's 58x3634u00b07
22 hours ago 6 Replies 3 Medals
arriya: who wanna play roblox
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!