///////////////////////////////////////////////////////////////class stackx private final int size private int[stprivate int toppublic stackx(/constructor st new int[size]/make array top - public void push(int /put item on stack st[++topjpublic int pop(/take item off stack return st[top--]public int peek(/peek at top of stack return st[top]public boolean isempty(/true if nothing on stack return (top =- )///////////////////////////////////////////////////////////////class vertex public char label/label ( ' 'public boolean wasvisited/public vertex(char lab/constructor label labwasvisited false//end class vertex ///////////////////////////////////////////////////////////////class graph private final int max_verts private vertex vertexlist[]/list of vertices private int adjmat[][]/adjacency matrix /current number of vertices private stackx thestack