Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //insere um novo elemento no próximo espaço vazio da fila
- public void inserir(int elemento){
- //se proximo vazio for igual a -1 ou quantidade de espaços vazios for menor ou igual ao tamanho da fila
- if(prox == -1 || (vazio <= fila.length && vazio != 0)){
- fila[prox+1] = elemento;
- prox++;
- vazio--;
- }else if(vazio == 0){
- System.out.println("A fila está cheia");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement