There is a specific input (Array) and I need to say what will be the output in line 14, what will be the output in line 17 etc. That's why I tried to convert the given pseudocode to java code, so I see from code what the output will be. Task also says that the pivot element is the element on the very left side of the divided array.
Pseudocode:
func int divide(S array; l, r integer){
val := S[r];
i := l;
j := r-1;
repeat
  while (S[i] <= val and i < r)
    i := i+1;
  end while;
  while (S[j] >= val and j > 1)
    j := j-1;
  end while;
  if i < j then
     swap (S[i], S[j]);
  end if;
until i >= j;
swap (S[i], S[r]);
return i;
}
Java Code:
public class Testt {
    public static void main (String[] args)
    {
        int[] S = {2, 10, 6, 7, 13, 4, 1, 12, 5, 9};
        int l = 0;
        int r = 0;
        int val;
        int i = 0;
        int j = 0;
        val = S[r];
        i = l;
        j = r-1;
        do
        {
            while (S[i] <= val && i < r) {
                i = i+1;
            }
            while (S[j] >= val && j > 1) {
                j = j - 1;
            }
            if (i < j) {
                S[j] = S[i];
            }
        } while (i >= j);
        S[r] = S[i];
        System.out.println(i);
    }
}
