reverse (left) arrow in an algorithm?

5k views Asked by At

There is a algorithm, in which author has written steps of algorithm like this,

  1. Initialization: Set up the threshold (th) and maximum iteration number, I.

    i ← 0

  2. Calculate x

    While (x > th) do

        i ← i+1

        ...

    End While

What does this left arrow means here?

2

There are 2 answers

0
riklund On BEST ANSWER

The left arrow statement here that the value i+1 is stored in the variable i.

That is, i is incremented by 1.

1
Dmitry Bychenko On

Left arrow (as well as right one) means assignment, in your case an equivalent C# code is

  i = 0;

  while (x > th) {
    i = i + 1;
    ...
  }