java stack (pilha)

Post on 06-Jul-2015

136 Views

Category:

Education

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

Implementação completa de uma Pilha (Stack) em Java usando testes JUnit.

TRANSCRIPT

StacksBy

Samuel T. C. Santos

samuel.santos@ccc.ufcg.edu.br

Stack

container

Object

of

is

inserted

removed

can be

principle

LILO

last-infirst-out

follow

derived

operations

push

pop

pushing

poping

The Stack abstract Data Type

• push(o) – insert object o at the top the stack.

• pop() – Remove from stack and return the topobject on the stack;

• size() – return the number of objects in thestack

• isEmpty () – return a boolean indicating if thestack is empty.

• top() – return the top object on the stack,without removing it;

The Stack abstract Data Type

• top() , pop() - An error occurs if the stack isempty;

• push () – An error occurs if the stack is full.

A simple Array-Based Implementation

• Stack - interface

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

A simple Array-Based Implementation

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

A simple Array-Based Implementation

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

A simple Array-Based Implementation

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

A simple Array-Based Implementation

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

A simple Array-Based Implementation

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

A simple Array-Based Implementation

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

A simple Array-Based Implementation

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

A simple Array-Based Implementation

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

A simple Array-Based Implementation

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

A simple Array-Based Implementation

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

A simple Array-Based Implementation

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

A simple Array-Based Implementation

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

A simple Array-Based Implementation

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

A simple Array-Based Implementation

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

Testing StackImpl

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

Testing StackImpl

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

Testing StackImpl

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

Testing StackImpl

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

Testing StackImpl

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

The End

https://github.com/samueltcsantos/atal/tree/master/src/edu/ufcg/adt/stack

top related