668
правок
Изменения
→Пример
<tex> void</tex> <tex> push</tex> <tex> (Object</tex> <tex> element)</tex>
<tex> pop:</tex>
<tex> pre: size > 0 </tex>
<tex>post: size == size' - 1 && result == elements[size]</tex>
<tex>Object pop() </tex>
<tex> peek:</tex>
<tex>pre: size > 0</tex>
<tex>post result == elements[size - 1]</tex>
<tex>Object peek() </tex>
<tex> size:</tex>
<tex>post: result == size </tex>
<tex>int size()</tex>
<tex>isEmpty:</tex>
<tex>post: result == size > 0</tex>
<tex>boolean isEmpty() </tex>