69
 правок
Изменения
→С помощью списка
</code> 
<code>
 '''int''' find(x):               <font color=green> // подразумевается, что <tex> x </tex> {{ --- }} ссылка на один из элементов </font>
     '''return''' x.head.data
</code> 
     '''if''' x == y
         '''return'''
     x.tail.next = y       <font color=green> // соединим списки </font>     x.tail.next = y     .tail       <font color=green> // сделаем корректную ссылку на <tex> tail </tex> в <tex> head</tex></font>     x.tail = '''while''' y.tail     <tex> \neq </tex> null       <font color=green> // скорректируем ссылки на <tex> head </tex> у элементов множества <tex> y </tex> </font>     '''while''' y <tex> \neq </tex> null
         y.head = x
         y = y.next