StackListRun

 avatar
unknown
java
9 months ago
608 B
39
Indexable
package StackNew;

public class StackListRun {
    public static void main(String[] args) {
        StackList st = new StackList();

        System.out.println("Awal: isEmpty=" + st.isEmpty() + ", size=" + st.size());
        st.traverse();

        st.push(7); st.push(14); st.push(21); st.push(28);
        st.traverse();

        System.out.println("PEEK: " + st.peek());

        System.out.println("POP: " + st.pop());
        System.out.println("POP: " + st.pop());
        st.traverse();

        st.clear();
        st.traverse();
        System.out.println("POP saat kosong: " + st.pop());
    }
}

Editor is loading...
Leave a Comment