Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Agregar estructura de datos cola #60

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,24 @@
"Java"
]
},
{
"name": "Cola",
"description": "Una colecciónn de elementos que son insertados y removidos siguiendo el comportamiento FIFO (Primero entrar, primero en salir)",
"filename": "queue",
"languages": [
"C++",
"Java"
]
},
{
"name": "Pila",
"description": "Una colección de elementos que son insertados y removidos acorde al comportamiento LIFO (último en entrar primero en salir)",
"filename": "stack",
"languages": [
"C++",
"Java"
]
},
{
"name": "Métodos/Funciones",
"description": "Declaración de métodos con parámetros",
Expand Down
5 changes: 5 additions & 0 deletions langs/C++/queue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
queue<int> q;
q.push(15); //Insertar
q.pop(); //Remover elemento del frente de la cola
q.front(); //Obtener el elemento superior sin removerlo
q.empty(); //Verificar si la cola esta vacia
5 changes: 5 additions & 0 deletions langs/C++/stack
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
stack<int> s;
s.push(15); //Inserta en el tope de la pila
s.top(); //Obtiene el elemento del tope de la pila
s.pop(); //Remueve el elemento del tope de la pila
s.empty(); //Verifica si la pila esta vacia
5 changes: 5 additions & 0 deletions langs/Java/queue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Queue<Integer> q = new LinkedList<Integer>();
q.add(15); //Insertar
q.poll(); //Obtener y remover el elemento del frente
q.peek(); //Obtener el elemento del frente sin removerlo
q.isEmpty(); //Verificar si la cola esta vacia
5 changes: 5 additions & 0 deletions langs/Java/stack
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Stack<Integer> s = new Stack<Integer>();
s.push(15); //Inserta un elemento al tope de la pila
s.peek(); //Obtiene el elemento del tope de la pila
s.pop(); //Obtiene y remueve el elemento del tope de la pila
s.empty(); //Verifica si la pila esta vacia