私には同じように見えるこれら2つの検索アルゴリズムがあります。なぜそれらが実際に異なるのか、誰かが私を助けることができますか?
Find ( x ) :
if x.parent = x then
return x
else
return Find ( x.parent )
対
Find ( x ) :
if x.parent = x then
return x
else
x.parent <- Find(x.parent)
return x.parent
私は最初のものを次のように解釈します
int i = 0;
return i++;
2番目のものは
int i = 0;
int tmp = i++;
return tmp
私とまったく同じです。