2 つのリンクされたリスト L1 と L2 を比較し、等しい要素を比較するアルゴリズムがあります。L2 から削除しながら、それらを 3 番目のリスト L3 に入れます。これがアルゴリズムが行うべきことのすべてであるかどうかはわかりませんが、たとえば「p1prec」などのいくつかの概念を理解していません。アルゴリズムの合理的な設計、全体像を知りたい。指示を一つ一つ調べて感覚を掴もうとすると、覚えようとしているような気がします。同様のアルゴリズムを設計する方法についてのアドバイスも大歓迎です。アルゴリズムは次のとおりです。
    Equal(L1,L2)
    head[L3] = NIL            //L3 is empty
    if head[L2] = NIL         //if there are no elements in L2 return NIL
       return L3
    p1 = head[L1]             //p1 points the head of L1
    p1prec = nil              //p1prec is supposed to be precedent I guess.
    while p1 =/= nil
          p2 = head[L2]       //p2 points head of L2
          p2prec = nil        //p2prec is precedent of p2; first cycle is nil
          while p2 =/= nil and key[p1] =/= key[p2]
                p2prec = p2          // pass p2 and p2prec through L2 until
                p2 = next[p2]        // key[p1] = key[p2]
          if p2 =/= nil        // if two elements are found equal
                next[p1prec] = next[p1]          // im not sure what this does
                insert(L3,p1)                    // insert the element in L3
                p1 = next[p1prec]                //neither this,
                next[p2prec] = next[p2]  //connects the p2prec with nextp2 because p2
                free(p2)                         //is going to be deleted
          p1prec = p1      //moves through L1, if no element of p2 is found          
          p1 = next[p1]                         //equal with first element of p1