Изменения
→Пример
Контракты:
<tex>push </tex>
<tex>pre: element != NULL </tex>
<tex>post: size = size' + 1</tex> <tex> and </tex> <tex> elements[size'] = element </tex><tex> void push(Object element)
<tex> pop:</tex>
<tex> pre: size > 0 </tex>
<tex>post: size == size' - 1</tex> <tex> and </tex> <tex>result == elements[size]</tex>
<tex> Object pop() </tex>
<tex> peek:</tex>
<tex>post: result == elements[size - 1]</tex>
<tex> Object peek() </tex>
<tex> size:</tex>
<tex>int</tex> <tex> size()</tex>
<tex>isEmpty:</tex>