SHOW:
|
|
- or go back to the newest paste.
| 1 | //f->lista | |
| 2 | //espera->queu | |
| 3 | - | if(!f.vazia()){
|
| 3 | + | |
| 4 | b) | |
| 5 | - | if(a.tipo=="prof{
|
| 5 | + | |
| 6 | if(f.comprimento()==cap){ //verifica se a lista já ta cheia->preenche queue
| |
| 7 | if(a.getTipo()=="prof{ //verifica o tipo
| |
| 8 | - | if(espera.frente().tipo=="prof"){
|
| 8 | + | |
| 9 | - | if(espera.ultimo()!="prof"){
|
| 9 | + | |
| 10 | if(espera.frente().getTipo()=="prof"){ //ve se a frente é um prof
| |
| 11 | if(espera.ultimo()!="prof"){ //ve se o ultimo não é um prof
| |
| 12 | boolean flag=false; | |
| 13 | - | if(aux.tipo!=prof){
|
| 13 | + | |
| 14 | espera.retira(aux); | |
| 15 | if(aux.getTipo()!="prof"){
| |
| 16 | espera.insere(a); | |
| 17 | flag=true; | |
| 18 | } | |
| 19 | espera.insere(aux); | |
| 20 | comp--; | |
| 21 | } | |
| 22 | }else | |
| 23 | espera.insere(a); | |
| 24 | - | |
| 24 | + | |
| 25 | espera.insere(a); | |
| 26 | //insere os elementos restantes na fila | |
| 27 | - | espera.isere(aux); |
| 27 | + | |
| 28 | espera.retira(aux); | |
| 29 | espera.insere(aux); | |
| 30 | } | |
| 31 | }else | |
| 32 | espera.insere(aux); | |
| 33 | - | }else |
| 33 | + | |
| 34 | - | f.insere(1,a); |
| 34 | + | |
| 35 | } |