for j = n − 1 to 1 step − 1 do
does this means for all j in [1 .. n-1] or [2 .. n-1] ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
for j = n − 1 to 1 step − 1 dois a countdown.It will start at j and count down to 1 (inclusive).
So if j is 6, then it will go down 5, 4, 3, 2, 1.
twist: Now if your j is a negative value, then you should consider that it will go upto the min negative first, then rollover to the max positive and then count down to 1.