Esempio n. 1
0
 // Remove um elemento
 int Remove(ref tp_fila f)
 {
     return(f.vetor[++f.inicio]);
 }
Esempio n. 2
0
 bool EstaCheia(tp_fila f)
 {
     return(f.fim == MAX - 1);
 }
Esempio n. 3
0
 // Insere um elemento
 void Insere(ref tp_fila f, int valor)
 {
     f.vetor[++f.fim] = valor;
 }
Esempio n. 4
0
 // Verificando limites
 bool EstaVazia(tp_fila f)
 {
     return(f.inicio == f.fim);
 }
Esempio n. 5
0
        tp_fila fila, filaNMe, filaNMa; //


        // Inicialização
        void Inicializa(ref tp_fila f)
        {
            f.inicio = f.fim = 1;
            f.vetor  = new int[MAX];
        }
Esempio n. 6
0
 int pico(ref tp_fila f)
 {
     return(f.vetor[f.inicio + 1]); //inicio começa de -1, mas o indice começa em 0
 }
Esempio n. 7
0
 int tamanho(ref tp_fila f)
 {
     return(f.fim - f.inicio);
 }
Esempio n. 8
0
 // Insere um elemento
 void Insere(ref tp_fila f, string valor)
 {
     f.vetor[++f.fim] = valor;
 }