https://pastebin.com/dxTJrHMw
Hi,
Case 1 when you are using kk:
lets say v={1,2,3}
then for i=0
kk=v[0]
and v[j]=v[j]-kk for j=0 to 2:
result: v={0,1,2}
Case 2:when you are using v[i]
then i=0
for (j=0 to 2)
when j=0 : v[0]=v[0]-v[0]=0
for j=1 v[1]-v[0]=2
for j=2 v[2]-v[0]=3
so new vector ={0,2,3}
Reason when you are using v[i] there in v[j]=v[j]-v[i], you are updating v[i] when j=i
Hit like if u get it
1 Like