I am not from cs background and I am trying to make sense of what is used for what. In pseudocode I see a lot of this:
for i <--- 1 to n-1 do
j <--- find-Min(A,i,n)
A[j] <-> A[i]
end for
What are <--- and <-> used to refer to?
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.
<---means “assign the right-hand side to the left-hand side” (it is somewhat strange to see this used in theforcase, as it might easily have been omitted there).<->means “swap”. A[j] value is swapped with A[i].EDIT:
It just occurred to me that the first line might be missing
iand should instead read:This becomes a legitimate use case of
<---described above:iis assigned values from1ton-1sequentially, and the loop body (down toend for, which denotes the end of loop) is executed for each of theseivalues.