colas

Description

crear cola y sus metodos
arual-168
Flashcards by arual-168, updated more than 1 year ago
arual-168
Created by arual-168 over 8 years ago
10
0

Resource summary

Question Answer
public class Ccolas { } Nodo frente, fin; int size;
contructor cola public Ccolas(){ frente=fin=null; size=0; }
push(){ } public void push(char e){ // Nodo nodo =new Nodo(e,null); if(size==0){ frente = nodo; } else{ fin.getSig(); fin=nodo; size++; } }
pop(){ } public char pop(){// if(isEmpty()){ System.out.println("cola vacia"); return'0'; } char aux = (char) frente.getElem(); frente = frente.getSig(); size--; if(size==0) fin=null; return aux; }
size(){ } public int size(){// return size; }
isEmpty(){ } public boolean isEmpty(){// if (size==0) return true; return false; }
frente(){ } public char frente(){// if(isEmpty()){ System.out.println("la cola esta vacia"); return '0'; } return (char) frente.getElem(); }
Show full summary Hide full summary

Similar

ESTRUCTURA DE DATOS
Lorena Modesto
Estructura de datos
Joaquin Ordoñez Soliz
PROGRAMACIÓN ORIENTADA A OBJETOS - TERCER CORTE
Jose Anacona Pira
EVENTOS EN JAVA
**CR 7**
Parcial Fundamento de Programación
ALBERTO MANUEL PATERNINA LEON
Java: Herencia y Polimorfismo
Ana Emilie
EVENTOS EN JAVA
LUIS NAKASIMA
Certificación Java 8 - Oracle Certified Associate - Tema 1 - Estructura de Clases
Miguel Gómez Cuesta
Interface en Java
tavoberry
EVENTOS EN JAVA
Diego Santos
Programación orientada a objetos usando java
ALEX Merino