001package components.stack; 002 003import java.util.Iterator; 004import java.util.NoSuchElementException; 005 006/** 007 * {@code Stack} represented as a singly linked list, done "bare-handed", with 008 * implementations of primary methods. 009 * 010 * <p> 011 * Execution-time performance of all methods implemented in this class is O(1). 012 * 013 * @param <T> 014 * type of Stack entries 015 * @convention <pre> 016 * $this.length >= 0 and 017 * if $this.length = 0 then 018 * [$this.top is null] 019 * else 020 * [$this.top is not null] and 021 * [$this.top points to the first node of a singly linked list 022 * containing $this.length nodes] and 023 * [next in the last node of that list is null] 024 * </pre> 025 * @correspondence this = [data in $this.length nodes starting at $this.top] 026 */ 027public class Stack2<T> extends StackSecondary<T> { 028 029 /* 030 * 2221/2231 assignment code deleted. 031 */ 032 033}