Your SlideShare is downloading. ×
Cola memoria dinamica
Cola memoria dinamica
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Cola memoria dinamica

1,117

Published on

Cola memoria dinamica

Cola memoria dinamica

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,117
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. PROGRAMA EN JAVA DONDE SE GUARDAN LOS CARACTERES DE UNAPALABRA EN UNA COLA CON MEMORIA DINAMICAClase Nodopublic class Nodo { char letra; Nodo despues; public Nodo() { }}En la Main.javaimport java.util.Scanner;public class Main { public Main() { } public static void main(String[] args) { // TODO code application logic here Nodo primero=null; Nodo ultimo=null; Nodo aux1 = null; String palabra; Scanner teclado = new Scanner(System.in); System.out.println("palabra "); palabra = teclado.nextLine(); for (int i=0;i<palabra.length();i++) { aux1 = ultimo; Nodo aux = new Nodo(); aux.despues = null; if (primero==null) { primero=aux; ultimo=aux; } else { aux1.despues = aux; ultimo = aux; } ultimo.letra=palabra.charAt(i); } aux1= primero; for (int j=0;j<palabra.length();j++) { System.out.println("letra " + aux1.letra); aux1 = aux1.despues; }
  • 2. }}

×