<--- and & # 8596; in pseudo code

I am not from the cs background, and I'm trying to understand what is used for what. In the pseudocode, I see a lot of things:

for i <---  1 to n-1 do
j <--- find-Min(A,i,n)
A[j] <-> A[i]
end for 

Which ones do <---they <->relate to?

+5
source share
3 answers

<---means "assign the right side to the left side" (it is somewhat strange to see that this is used in the case for, since it could easily be omitted there).

<->means swap. The value of [j] is replaced by A [i].

EDIT

It occurred to me that the first line might be missing iand should read:

for i <---  1 to n-1 do

<---, : i 1 n-1, ( end for, ) i.

+8

, .

, <--- " ", <-> " ".

, , , . , :

for i <--- 1 to n-1 do

, for, :

for i = 1 to n-1

BASIC, :

for (i=1; i<n; i++)

C- .

+3

, , , .

for i <- 1 to n-1 do 

:

  • ;
  • R, S, Scala OCaml;
  • APL.

-

, .

, - .

+1
source

All Articles