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

Of the source code for merge sort in 10th lecture, there are several sort of "i = i+1" lines. I tried them with "i += i", which got the programme into inf.loop. Can anyone explain why does it happen? I thought "i = i+1" and "i += i" are quietly same thing, was I wrong?

OpenStudy (espex):

That convention is not supported in every programming language.

OpenStudy (anonymous):

whoops, my bad. 'i += i' is not identical to 'i = i + 1' 'i += 1' IS identical to 'i = i + 1' A basic mistake have I made.

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!
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!