Изменения
→Псевдокод
== Псевдокод ==
head = H
'''if ''' (CAS (&H, head, head.next)) '''return ''' head.value } } fun '''pushfun'''push(x: '''Int''') { '''while ''' ('''true''') { <font color=green>//Cas loop</font>
head = H
'''if ''' (head == null) '''throw ''' new EmptyStackException();
newHead = Node {value: x, next: head}
'''if ''' (CAS (&H, head, newHead)) '''return''' } }
==Примечания==