SlideShare una empresa de Scribd logo
1 de 5
Fondo
E CD
Frente
Por aquí
entran
Por aquí
salen
Frente
C ED
Fondo
Por aquí
entran
Por aquí
salen
Una Cola es una estructura en donde cada elemento se suprime por el
frente y son insertados por el fondo. Una Cola es el tipo FIFO (First In First
Out), esto implica que el primer elemento en entrar será el primero en
salir.
Colas
ACB
A
A
BC
A
Arrancamos con
la cola vacía, sin
elementos.
En la cabecera
no vemos
elemento
alguno.
Ya tenemos un
primer
elemento
agregado a la
cola.
Podemos ver el
elemento A en
la cabecera (al
frente).
Al agregar B,
éste queda
detrás de A.
A, el primer
elemento agregado,
sigue al frente; B
queda oculto e
inaccesible.
Lo mismo pasa con C,
que queda encolado
detrás de B.
C deberá esperar a
que se desencolen A y
B para llegar al frente.
B, ahora, queda en la
cabecera, mientras C
sigue oculto tras
éste, e inaccesible.
Podemos seguir así hasta
vaciar la cola.
Pero, si viniese nuevamente
A y lo agregásemos a la cola,
¿en qué posición quedaría?
A
Quedaría al
final,
encolado
detrás de C.
Al extraer el
primer elemento
insertado, B pasa
al frente.
Funcionamiento de una Cola
Estados de una Cola
Cola Vacía
a) En la operación Mostrar
SI ULTIMO=0 ENTONCES
IMPRIMIR(“La Cola está vacia”)
SINO
IMPRIMIR(“Mostrar los elementos de la Cola”)
FIN-SI
b) En la operación Eliminar
SI ULTIMO=PENULTIMO ENTONCES
IMPRIMIR(“La Cola está vacia”)
SINO
IMPRIMIR(“Eliminar elemento de la Cola”)
FIN-SI
Estados de una Cola
Cola Llena
Sucede cuando no hay más lugar para almacenar elementos
SI ULTIMO>MAX ENTONCES
IMPRIMIR(“La Cola está llena”)
SINO
IMPRIMIR(“Hay espacio en la Cola…se puede insertar
elemento”)
FIN-SI
Algoritmo Insertar
//Ultimo, MAX, Cola (arreglo unidimensional)
Insertar()
SI Ultimo=MAX ENTONCES
IMPRIMIR(“La cola está llena”)
Sino
IMPRIMIR(“Inserte un elemento en la Cola”)
LEER(Cola(Ultimo))
Ultimo=Ultimo+1
FIN-SI
FIN-Funcion Insertar
Algoritmo Mostrar
SI Ultimo=0 ENTONCES
IMPRIMIR(“COLA ESTA VACIA”)
DE OTRO MODO
PARA Z=PENULTIMO,ULTIMO-1,1
IMPRIMIR(Cola(Z))
FIN-PARA
FIN-SI
Algoritmo Eliminar
// Ultimo, Penultimo, Cola – arreglo entero
SI Ultimo=Penultimo ENTONCES
IMPRIMIR(“La cola está vacía”)
SINO
Penultimo=Penultimo+1
IMPRIMIR(“Elemento eliminado de la Cola”)
FIN-SI
FIN-Funcion Eliminar

Más contenido relacionado

Último

LA JUNGLA DE COLORES.pptx Cuento de animales
LA JUNGLA DE COLORES.pptx  Cuento de animalesLA JUNGLA DE COLORES.pptx  Cuento de animales
LA JUNGLA DE COLORES.pptx Cuento de animalesanllamas
 
Prueba de evaluación Geografía e Historia Comunidad de Madrid 4ºESO
Prueba de evaluación Geografía e Historia Comunidad de Madrid 4ºESOPrueba de evaluación Geografía e Historia Comunidad de Madrid 4ºESO
Prueba de evaluación Geografía e Historia Comunidad de Madrid 4ºESOluismii249
 
🦄💫4° SEM32 WORD PLANEACIÓN PROYECTOS DARUKEL 23-24.docx
🦄💫4° SEM32 WORD PLANEACIÓN PROYECTOS DARUKEL 23-24.docx🦄💫4° SEM32 WORD PLANEACIÓN PROYECTOS DARUKEL 23-24.docx
🦄💫4° SEM32 WORD PLANEACIÓN PROYECTOS DARUKEL 23-24.docxEliaHernndez7
 
AEC 2. Aventura en el Antiguo Egipto.pptx
AEC 2. Aventura en el Antiguo Egipto.pptxAEC 2. Aventura en el Antiguo Egipto.pptx
AEC 2. Aventura en el Antiguo Egipto.pptxhenarfdez
 
SISTEMA RESPIRATORIO PARA NIÑOS PRIMARIA
SISTEMA RESPIRATORIO PARA NIÑOS PRIMARIASISTEMA RESPIRATORIO PARA NIÑOS PRIMARIA
SISTEMA RESPIRATORIO PARA NIÑOS PRIMARIAFabiolaGarcia751855
 
Posición astronómica y geográfica de Europa.pptx
Posición astronómica y geográfica de Europa.pptxPosición astronómica y geográfica de Europa.pptx
Posición astronómica y geográfica de Europa.pptxBeatrizQuijano2
 
UNIDAD DE APRENDIZAJE DE PRIMER GRADO DEL MES DE MAYO PARA TRABAJAR CON ESTUD...
UNIDAD DE APRENDIZAJE DE PRIMER GRADO DEL MES DE MAYO PARA TRABAJAR CON ESTUD...UNIDAD DE APRENDIZAJE DE PRIMER GRADO DEL MES DE MAYO PARA TRABAJAR CON ESTUD...
UNIDAD DE APRENDIZAJE DE PRIMER GRADO DEL MES DE MAYO PARA TRABAJAR CON ESTUD...rosalindatellodelagu
 
Desarrollo y Aplicación de la Administración por Valores
Desarrollo y Aplicación de la Administración por ValoresDesarrollo y Aplicación de la Administración por Valores
Desarrollo y Aplicación de la Administración por ValoresJonathanCovena1
 
prostitución en España: una mirada integral!
prostitución en España: una mirada integral!prostitución en España: una mirada integral!
prostitución en España: una mirada integral!CatalinaAlfaroChryso
 
Concepto y definición de tipos de Datos Abstractos en c++.pptx
Concepto y definición de tipos de Datos Abstractos en c++.pptxConcepto y definición de tipos de Datos Abstractos en c++.pptx
Concepto y definición de tipos de Datos Abstractos en c++.pptxFernando Solis
 
PLAN DE REFUERZO ESCOLAR MERC 2024-2.docx
PLAN DE REFUERZO ESCOLAR MERC 2024-2.docxPLAN DE REFUERZO ESCOLAR MERC 2024-2.docx
PLAN DE REFUERZO ESCOLAR MERC 2024-2.docxiemerc2024
 
AEC2. Egipto Antiguo. Adivina, Adivinanza.pptx
AEC2. Egipto Antiguo. Adivina, Adivinanza.pptxAEC2. Egipto Antiguo. Adivina, Adivinanza.pptx
AEC2. Egipto Antiguo. Adivina, Adivinanza.pptxhenarfdez
 
La Evaluacion Formativa SM6 Ccesa007.pdf
La Evaluacion Formativa SM6  Ccesa007.pdfLa Evaluacion Formativa SM6  Ccesa007.pdf
La Evaluacion Formativa SM6 Ccesa007.pdfDemetrio Ccesa Rayme
 
6°_GRADO_-_MAYO_06 para sexto grado de primaria
6°_GRADO_-_MAYO_06 para sexto grado de primaria6°_GRADO_-_MAYO_06 para sexto grado de primaria
6°_GRADO_-_MAYO_06 para sexto grado de primariaWilian24
 
CONCURSO NACIONAL JOSE MARIA ARGUEDAS.pptx
CONCURSO NACIONAL JOSE MARIA ARGUEDAS.pptxCONCURSO NACIONAL JOSE MARIA ARGUEDAS.pptx
CONCURSO NACIONAL JOSE MARIA ARGUEDAS.pptxroberthirigoinvasque
 
Tema 10. Dinámica y funciones de la Atmosfera 2024
Tema 10. Dinámica y funciones de la Atmosfera 2024Tema 10. Dinámica y funciones de la Atmosfera 2024
Tema 10. Dinámica y funciones de la Atmosfera 2024IES Vicent Andres Estelles
 
TEMA 14.DERIVACIONES ECONÓMICAS, SOCIALES Y POLÍTICAS DEL PROCESO DE INTEGRAC...
TEMA 14.DERIVACIONES ECONÓMICAS, SOCIALES Y POLÍTICAS DEL PROCESO DE INTEGRAC...TEMA 14.DERIVACIONES ECONÓMICAS, SOCIALES Y POLÍTICAS DEL PROCESO DE INTEGRAC...
TEMA 14.DERIVACIONES ECONÓMICAS, SOCIALES Y POLÍTICAS DEL PROCESO DE INTEGRAC...jlorentemartos
 

Último (20)

Interpretación de cortes geológicos 2024
Interpretación de cortes geológicos 2024Interpretación de cortes geológicos 2024
Interpretación de cortes geológicos 2024
 
LA JUNGLA DE COLORES.pptx Cuento de animales
LA JUNGLA DE COLORES.pptx  Cuento de animalesLA JUNGLA DE COLORES.pptx  Cuento de animales
LA JUNGLA DE COLORES.pptx Cuento de animales
 
Prueba de evaluación Geografía e Historia Comunidad de Madrid 4ºESO
Prueba de evaluación Geografía e Historia Comunidad de Madrid 4ºESOPrueba de evaluación Geografía e Historia Comunidad de Madrid 4ºESO
Prueba de evaluación Geografía e Historia Comunidad de Madrid 4ºESO
 
🦄💫4° SEM32 WORD PLANEACIÓN PROYECTOS DARUKEL 23-24.docx
🦄💫4° SEM32 WORD PLANEACIÓN PROYECTOS DARUKEL 23-24.docx🦄💫4° SEM32 WORD PLANEACIÓN PROYECTOS DARUKEL 23-24.docx
🦄💫4° SEM32 WORD PLANEACIÓN PROYECTOS DARUKEL 23-24.docx
 
AEC 2. Aventura en el Antiguo Egipto.pptx
AEC 2. Aventura en el Antiguo Egipto.pptxAEC 2. Aventura en el Antiguo Egipto.pptx
AEC 2. Aventura en el Antiguo Egipto.pptx
 
SISTEMA RESPIRATORIO PARA NIÑOS PRIMARIA
SISTEMA RESPIRATORIO PARA NIÑOS PRIMARIASISTEMA RESPIRATORIO PARA NIÑOS PRIMARIA
SISTEMA RESPIRATORIO PARA NIÑOS PRIMARIA
 
Posición astronómica y geográfica de Europa.pptx
Posición astronómica y geográfica de Europa.pptxPosición astronómica y geográfica de Europa.pptx
Posición astronómica y geográfica de Europa.pptx
 
UNIDAD DE APRENDIZAJE DE PRIMER GRADO DEL MES DE MAYO PARA TRABAJAR CON ESTUD...
UNIDAD DE APRENDIZAJE DE PRIMER GRADO DEL MES DE MAYO PARA TRABAJAR CON ESTUD...UNIDAD DE APRENDIZAJE DE PRIMER GRADO DEL MES DE MAYO PARA TRABAJAR CON ESTUD...
UNIDAD DE APRENDIZAJE DE PRIMER GRADO DEL MES DE MAYO PARA TRABAJAR CON ESTUD...
 
Desarrollo y Aplicación de la Administración por Valores
Desarrollo y Aplicación de la Administración por ValoresDesarrollo y Aplicación de la Administración por Valores
Desarrollo y Aplicación de la Administración por Valores
 
prostitución en España: una mirada integral!
prostitución en España: una mirada integral!prostitución en España: una mirada integral!
prostitución en España: una mirada integral!
 
Concepto y definición de tipos de Datos Abstractos en c++.pptx
Concepto y definición de tipos de Datos Abstractos en c++.pptxConcepto y definición de tipos de Datos Abstractos en c++.pptx
Concepto y definición de tipos de Datos Abstractos en c++.pptx
 
PLAN DE REFUERZO ESCOLAR MERC 2024-2.docx
PLAN DE REFUERZO ESCOLAR MERC 2024-2.docxPLAN DE REFUERZO ESCOLAR MERC 2024-2.docx
PLAN DE REFUERZO ESCOLAR MERC 2024-2.docx
 
Supuestos_prácticos_funciones.docx
Supuestos_prácticos_funciones.docxSupuestos_prácticos_funciones.docx
Supuestos_prácticos_funciones.docx
 
AEC2. Egipto Antiguo. Adivina, Adivinanza.pptx
AEC2. Egipto Antiguo. Adivina, Adivinanza.pptxAEC2. Egipto Antiguo. Adivina, Adivinanza.pptx
AEC2. Egipto Antiguo. Adivina, Adivinanza.pptx
 
La Evaluacion Formativa SM6 Ccesa007.pdf
La Evaluacion Formativa SM6  Ccesa007.pdfLa Evaluacion Formativa SM6  Ccesa007.pdf
La Evaluacion Formativa SM6 Ccesa007.pdf
 
6°_GRADO_-_MAYO_06 para sexto grado de primaria
6°_GRADO_-_MAYO_06 para sexto grado de primaria6°_GRADO_-_MAYO_06 para sexto grado de primaria
6°_GRADO_-_MAYO_06 para sexto grado de primaria
 
CONCURSO NACIONAL JOSE MARIA ARGUEDAS.pptx
CONCURSO NACIONAL JOSE MARIA ARGUEDAS.pptxCONCURSO NACIONAL JOSE MARIA ARGUEDAS.pptx
CONCURSO NACIONAL JOSE MARIA ARGUEDAS.pptx
 
Tema 10. Dinámica y funciones de la Atmosfera 2024
Tema 10. Dinámica y funciones de la Atmosfera 2024Tema 10. Dinámica y funciones de la Atmosfera 2024
Tema 10. Dinámica y funciones de la Atmosfera 2024
 
TEMA 14.DERIVACIONES ECONÓMICAS, SOCIALES Y POLÍTICAS DEL PROCESO DE INTEGRAC...
TEMA 14.DERIVACIONES ECONÓMICAS, SOCIALES Y POLÍTICAS DEL PROCESO DE INTEGRAC...TEMA 14.DERIVACIONES ECONÓMICAS, SOCIALES Y POLÍTICAS DEL PROCESO DE INTEGRAC...
TEMA 14.DERIVACIONES ECONÓMICAS, SOCIALES Y POLÍTICAS DEL PROCESO DE INTEGRAC...
 
Tema 11. Dinámica de la hidrosfera 2024
Tema 11.  Dinámica de la hidrosfera 2024Tema 11.  Dinámica de la hidrosfera 2024
Tema 11. Dinámica de la hidrosfera 2024
 

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Clase colas

  • 1. Fondo E CD Frente Por aquí entran Por aquí salen Frente C ED Fondo Por aquí entran Por aquí salen Una Cola es una estructura en donde cada elemento se suprime por el frente y son insertados por el fondo. Una Cola es el tipo FIFO (First In First Out), esto implica que el primer elemento en entrar será el primero en salir. Colas
  • 2. ACB A A BC A Arrancamos con la cola vacía, sin elementos. En la cabecera no vemos elemento alguno. Ya tenemos un primer elemento agregado a la cola. Podemos ver el elemento A en la cabecera (al frente). Al agregar B, éste queda detrás de A. A, el primer elemento agregado, sigue al frente; B queda oculto e inaccesible. Lo mismo pasa con C, que queda encolado detrás de B. C deberá esperar a que se desencolen A y B para llegar al frente. B, ahora, queda en la cabecera, mientras C sigue oculto tras éste, e inaccesible. Podemos seguir así hasta vaciar la cola. Pero, si viniese nuevamente A y lo agregásemos a la cola, ¿en qué posición quedaría? A Quedaría al final, encolado detrás de C. Al extraer el primer elemento insertado, B pasa al frente. Funcionamiento de una Cola
  • 3. Estados de una Cola Cola Vacía a) En la operación Mostrar SI ULTIMO=0 ENTONCES IMPRIMIR(“La Cola está vacia”) SINO IMPRIMIR(“Mostrar los elementos de la Cola”) FIN-SI b) En la operación Eliminar SI ULTIMO=PENULTIMO ENTONCES IMPRIMIR(“La Cola está vacia”) SINO IMPRIMIR(“Eliminar elemento de la Cola”) FIN-SI
  • 4. Estados de una Cola Cola Llena Sucede cuando no hay más lugar para almacenar elementos SI ULTIMO>MAX ENTONCES IMPRIMIR(“La Cola está llena”) SINO IMPRIMIR(“Hay espacio en la Cola…se puede insertar elemento”) FIN-SI Algoritmo Insertar //Ultimo, MAX, Cola (arreglo unidimensional) Insertar() SI Ultimo=MAX ENTONCES IMPRIMIR(“La cola está llena”) Sino IMPRIMIR(“Inserte un elemento en la Cola”) LEER(Cola(Ultimo)) Ultimo=Ultimo+1 FIN-SI FIN-Funcion Insertar
  • 5. Algoritmo Mostrar SI Ultimo=0 ENTONCES IMPRIMIR(“COLA ESTA VACIA”) DE OTRO MODO PARA Z=PENULTIMO,ULTIMO-1,1 IMPRIMIR(Cola(Z)) FIN-PARA FIN-SI Algoritmo Eliminar // Ultimo, Penultimo, Cola – arreglo entero SI Ultimo=Penultimo ENTONCES IMPRIMIR(“La cola está vacía”) SINO Penultimo=Penultimo+1 IMPRIMIR(“Elemento eliminado de la Cola”) FIN-SI FIN-Funcion Eliminar