<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6872164117673495836</id><updated>2024-09-09T04:27:01.742-06:00</updated><category term="netbeans"/><category term="jcreator"/><category term="ingeniería"/><category term="informática"/><category term="sistemas"/><category term="fuente"/><category term="java"/><category term="computación"/><category term="código"/><category term="código fuente"/><category term="código java"/><category term="beans"/><category term="net"/><category term="agregar"/><category term=".java"/><category term="alta"/><category term="baja"/><category term="comparar"/><category term="imprimir"/><category term="ingeniería en computación"/><category term="lista"/><category term="lista simple"/><category term="metodos"/><category term="nodos"/><category term="progrmacion en java"/><category term="aplicación de una lista"/><category term="arbor binario en jaja"/><category term="autómata finito determinista"/><category term="blog de códigos"/><category term="c"/><category term="c++"/><category term="codigo"/><category term="codigo fuente"/><category term="codigo fuente en java"/><category term="codigo java"/><category term="comprobar"/><category term="condigo fuente en java"/><category term="consonante"/><category term="cpp"/><category term="código fuente java"/><category term="doble"/><category term="doblemente enlazada"/><category term="estructura de datos en java"/><category term="factorial"/><category term="fibonacci"/><category term="hanoi"/><category term="lista circular doble"/><category term="lista circular doblemente ligada"/><category term="lista doble"/><category term="lista doble en java"/><category term="lista doblemente ligada en java"/><category term="lista sencilla"/><category term="par o primo identificar"/><category term="programa con un lista"/><category term="programación"/><category term="programación en java"/><category term="progrmacion en java código fuente java jcreator arbor binario en jaja netbeans estructura de datos en java"/><category term="quitar"/><category term="recorrido"/><category term="sencilla"/><category term="series de fibonacci"/><category term="sucesión de fibonacci"/><category term="torres"/><category term="torres de hanoi"/><category term="uso estructura de datos en c"/><category term="vocal"/><title type='text'>Cosas para Futuros Ingenieros</title><subtitle type='html'>Estudiantes de Computación o Informática.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://cosasparafuturosingenieros.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Diego Agustín Moreno</name><uri>http://www.blogger.com/profile/16423070987153712849</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-LQ7aB6yKZ3E68XnjxSrKHMo0pXCtNPZ_7VwvrbhW75Sf7RGVLneoBz-gf5BicW_xYxwcOV4wpHWHleH17UiojkOc20ONOqGr5pcf5o8wvXxHvoBQp69WkWNDotkRw/s113/damv.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6872164117673495836.post-4729835685885486830</id><published>2013-01-10T21:02:00.002-06:00</published><updated>2013-07-11T16:40:29.686-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="autómata finito determinista"/><category scheme="http://www.blogger.com/atom/ns#" term="c"/><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><category scheme="http://www.blogger.com/atom/ns#" term="cpp"/><category scheme="http://www.blogger.com/atom/ns#" term="código fuente"/><category scheme="http://www.blogger.com/atom/ns#" term="ingeniería"/><category scheme="http://www.blogger.com/atom/ns#" term="programación"/><category scheme="http://www.blogger.com/atom/ns#" term="uso estructura de datos en c"/><title type='text'>Código Fuente en C AFD con Listas</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Este programa en Lenguaje de&amp;nbsp;Programación&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/C_(lenguaje_de_programaci%C3%B3n)&quot; target=&quot;_blank&quot;&gt;C&lt;/a&gt;&amp;nbsp;es un&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Aut%C3%B3mata_finito_determinista&quot; target=&quot;_blank&quot;&gt;Autómata&amp;nbsp;Finito Determinista&lt;/a&gt;, El AFD esta definido por la&amp;nbsp;expresión&amp;nbsp;regular &amp;nbsp;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-small; line-height: 16px;&quot;&gt;ε&lt;/span&gt;∪(b +&amp;nbsp;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-small; line-height: 16px;&quot;&gt;ε&lt;/span&gt;)(ab)∗∪ (a +&amp;nbsp;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-small; line-height: 16px;&quot;&gt;ε&lt;/span&gt;)(ba)∗. Esta&amp;nbsp;expresión&amp;nbsp;no acepta las subcadenas aa y bb.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;El programa puede ser de gran utilidad en las materias sobre&amp;nbsp;Teoría&amp;nbsp;de&amp;nbsp;Autómatas.&amp;nbsp;Para armar un AFD distinto, lo&amp;nbsp;que tienes que cambiar son las conexiones de los nodos, que se encuentran el&amp;nbsp;método&amp;nbsp;crear(), que es donde se arma el AFD, y obviamente, si el AFD que quieres&amp;nbsp;construir&amp;nbsp;tiene mas estados, pues&amp;nbsp;tendrás&amp;nbsp;que&amp;nbsp;declarar&amp;nbsp;mas nodos y si&amp;nbsp;evalúa&amp;nbsp;mas&amp;nbsp;símbolos&amp;nbsp;pues los agregas en el switch, ten en cuenta que agregar mas&amp;nbsp;símbolos implica que&amp;nbsp;tendrás&amp;nbsp;que declarar mas enlaces dentro de la estructura.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;El&amp;nbsp;programa en &lt;a href=&quot;http://es.wikipedia.org/wiki/C_(lenguaje_de_programaci%C3%B3n)&quot; target=&quot;_blank&quot;&gt;C&lt;/a&gt; fue diseñado en &lt;a href=&quot;http://es.wikipedia.org/wiki/Dev-C%2B%2B&quot; target=&quot;_blank&quot;&gt;Dev-C++&lt;/a&gt;, que si no lo tienes te recomiendo que lo descargues&amp;nbsp;&lt;a href=&quot;http://www.bloodshed.net/dev/devcpp.html&quot; target=&quot;_blank&quot;&gt;aquí&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Código&amp;nbsp;Fuente en C&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;pre class=&quot;brush: cpp&quot;&gt;#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;string.h&amp;gt;

struct lista_elementos
{
  int estado;
  struct lista_elementos *a;
  struct lista_elementos *b;
};

typedef struct lista_elementos nodo;

void crear(nodo *q0,nodo *q1,nodo *q2,nodo *q3,
nodo *actual, nodo *anterior);
void mostrar(nodo *pt,nodo *pt2,int j,char i);

main()
{
nodo *q0,*q1,*q2,*q3,*actual,*anterior;
int j=0,i=0,tamano=0,novalido=0; char cadena[100];
actual=(nodo*)malloc(sizeof(nodo));
q0=(nodo*)malloc(sizeof(nodo));
q1=(nodo*)malloc(sizeof(nodo));
q2=(nodo*)malloc(sizeof(nodo));
q3=(nodo*)malloc(sizeof(nodo));
crear(q0,q1,q2,q3,actual,anterior);

printf(&quot;\n\n\n\t AFD Que no acepte las subcadenas aa y bb\n\n&quot;);
printf(&quot;  Ingrese Cadena: &quot;);
gets(cadena);
tamano = strlen(cadena);

while (i &amp;lt; tamano &amp;amp;&amp;amp; novalido==0){
    j=i+1;
    switch(cadena[i]){
        case &#39;a&#39;:
            if(actual-&amp;gt;a==NULL){
                anterior=q0;
                actual=anterior-&amp;gt;a;
                mostrar(anterior,actual,j,cadena[i]);
            }else{
                anterior=actual;
                actual=anterior-&amp;gt;a;
                mostrar(anterior,actual,j,cadena[i]);
            }                        
            break;
        case &#39;b&#39;:
            if(actual-&amp;gt;b==NULL){
                anterior=q0;
                actual=anterior-&amp;gt;b;
                mostrar(anterior,actual,j,cadena[i]);
            }else{
                anterior=actual;
                actual=anterior-&amp;gt;b;
                mostrar(anterior,actual,j,cadena[i]);}                        
            break;
          default:
              novalido=1;
              break;
           }
           i++;
}
if(actual-&amp;gt;estado==1||actual-&amp;gt;estado==4||novalido==1){
          printf(&quot;\n\n\t ------------------------- &quot;);
         printf(&quot;\n\t --- Cadena Rechazada! --- \n&quot;);
          printf(&quot;\t ------------------------- \n\n&quot;);
          }
else{
         printf(&quot;\n\n\t ------------------------ &quot;);
         printf(&quot;\n\t --- Cadena Aceptada! --- \n&quot;);
          printf(&quot;\t ------------------------ \n\n&quot;);
          }
      getchar();
}

void crear(nodo *q0,nodo *q1,nodo *q2,nodo *q3,nodo *actual, nodo *anterior)
{
      
      q0-&amp;gt;a=q2;
      q0-&amp;gt;b=q1;
      q1-&amp;gt;a=q2;
      q1-&amp;gt;b=q3;
      q2-&amp;gt;a=q3;
      q2-&amp;gt;b=q1;
      q3-&amp;gt;a=q3;
      q3-&amp;gt;b=q3;
      q0-&amp;gt;estado=1;
      q1-&amp;gt;estado=2;
      q2-&amp;gt;estado=3;
      q3-&amp;gt;estado=4;
      actual-&amp;gt;a=NULL;
      actual-&amp;gt;b=NULL;
      anterior-&amp;gt;a=NULL;
      anterior-&amp;gt;b=NULL;
}

void mostrar(nodo *pt,nodo *pt2, int j,char i)
{     int fuente=0,destino=0;
      fuente=pt-&amp;gt;estado;destino=pt2-&amp;gt;estado;
      fuente=fuente-1;destino=destino-1;
      printf(&quot;\n\n Movimiento: %d&quot;,j);
      printf(&quot;  Para el simbolo: %c&quot;,i);
      if(j==0){
      printf(&quot;\n\n\t Desde el Inicio&quot;);}
      else{
        printf(&quot;\n\n\t Del Estado: q%d&quot;,fuente);
        printf(&quot;\t A el Estado: q%d&quot;,destino);
        }
}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://cosasparafuturosingenieros.blogspot.com/feeds/4729835685885486830/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2013/01/codigo-fuente-en-c-afd-con-listas.html#comment-form' title='1 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/4729835685885486830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/4729835685885486830'/><link rel='alternate' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2013/01/codigo-fuente-en-c-afd-con-listas.html' title='Código Fuente en C AFD con Listas'/><author><name>Diego Agustín Moreno</name><uri>http://www.blogger.com/profile/16423070987153712849</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-LQ7aB6yKZ3E68XnjxSrKHMo0pXCtNPZ_7VwvrbhW75Sf7RGVLneoBz-gf5BicW_xYxwcOV4wpHWHleH17UiojkOc20ONOqGr5pcf5o8wvXxHvoBQp69WkWNDotkRw/s113/damv.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6872164117673495836.post-4179942723891287030</id><published>2012-11-11T14:42:00.000-06:00</published><updated>2013-07-11T16:14:09.760-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="aplicación de una lista"/><category scheme="http://www.blogger.com/atom/ns#" term="codigo fuente en java"/><category scheme="http://www.blogger.com/atom/ns#" term="doble"/><category scheme="http://www.blogger.com/atom/ns#" term="jcreator"/><category scheme="http://www.blogger.com/atom/ns#" term="lista doble en java"/><category scheme="http://www.blogger.com/atom/ns#" term="lista doblemente ligada en java"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="programa con un lista"/><category scheme="http://www.blogger.com/atom/ns#" term="programación en java"/><title type='text'>Código Fuente Java: Programa para Inventario de Pacientes</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;En este programa aplicamos una lista doblemente ligada, a un caso real, se trata de un programa que lleve el inventario de pacientes, de digamos un hospital. Si bien el programa resulta sencillo, nos da una clara idea de como implementar estructura de datos en la vida real.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;El programa como en todos los vistos&amp;nbsp;aquí&amp;nbsp; se&amp;nbsp;constituye&amp;nbsp;de 3 clases: clase nodo de la estructura, clase paciente en donde manipulamos la lista, y clase main que es la que controla todo el programa.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 19px;&quot;&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;
&lt;/span&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;La clase mas&amp;nbsp;importante&amp;nbsp;seria la clase paciente, porque&amp;nbsp;ahí&amp;nbsp;están&amp;nbsp;lo&amp;nbsp;métodos&amp;nbsp;que realizan las operaciones mas importantes. &amp;nbsp;esta clase contiene los&amp;nbsp;métodos&amp;nbsp;que&amp;nbsp;normalmente&amp;nbsp;han&amp;nbsp;llevado las&amp;nbsp;listas&amp;nbsp;aquí&amp;nbsp;vistas, en cuanto a los&amp;nbsp;demás, &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;listanombres() se encarga de imprimir los nombres de todos los pacientes en la lista,&amp;nbsp;contotal() se encarga de contar a todos los pacientes,&amp;nbsp;&amp;nbsp;conniño() cuenta a los pacientes &amp;nbsp;menores a 13 años, conjove() cuenta a los pacientes entre 13 y 24 años, conadul() cuanta a los pacientes mayores de 24 años,&amp;nbsp;&amp;nbsp;totalhom() obtiene el total de hombres en la lista de pacientes y totalmuj() a las&amp;nbsp;mujeres&amp;nbsp;pacientes.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;El programa en&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; outline: none; text-align: justify; text-decoration: initial;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;&amp;nbsp;&amp;nbsp;esta compilado en&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/NetBeans&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; outline: none; text-align: justify; text-decoration: initial;&quot; target=&quot;_blank&quot;&gt;NetBeans&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;, que si no lo tienes te recomiendo que lo descargues&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://netbeans.org/downloads/index.html&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; outline: none; text-align: justify; text-decoration: initial;&quot; target=&quot;_blank&quot;&gt;aquí&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;Aquí&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp;el&amp;nbsp;código&amp;nbsp;fuente:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;b&gt;Clase Nodo&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:java&quot;&gt;class nodo
{
 String nomb,sex,domi; int edad, tel;
 nodo next;
 nodo ant;
 nodo(String n, String s, String d, int e, int t)
 {
  this.nomb=n; this.sex=s;this.domi=d;this.edad=e;this.tel=t;
  this.next=null;
  this.ant=null;
 }
}
&lt;/pre&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;b&gt;Clase Pacientes&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:java&quot;&gt;public class pacientes
{
 nodo primero;
 nodo ultimo;
 pacientes()
 {
  primero=null;
  ultimo=null;
 }

 public boolean estavacio()
 {
  if(primero==null) return true;
  else return false;
 }

 public pacientes alta(String dat,String dat2,
String dat3,int dat4,int dat5)
 {
  if(estavacio())
  {
   nodo nuevo=new nodo(dat,dat2,dat3,dat4,dat5);
   primero=nuevo;
   ultimo=nuevo;
  }
  else
  {
   nodo nuevo=new nodo(dat,dat2,dat3,dat4,dat5);
   ultimo.next=nuevo;
   nuevo.ant=ultimo;
   ultimo=nuevo;
  }
  return this;
 }


  public void listanombres()
 {
  nodo actual;
  actual=primero;
  while(actual!=ultimo)
  {
   System.out.println(actual.nomb);
   actual=actual.next;
  }
                System.out.println(actual.nomb);

 }

       double tnodos=0,niños=0,jove=0,adul=0,thom=0,tmuj=0,proniños=0,projove=0,pronadul=0,pronhom=0,promuj=0;

       public void contotal(nodo dat)
       {
           if(dat==null) return;
           tnodos=tnodos+1;
           contotal(dat.next);
       }

       public void conniño(nodo dat)
       {
           int n=13;
           if(dat==null) return;
           if(dat.edad&amp;lt;=n){
           niños=niños+1;}
           conniño(dat.next);
       }

       public void conjove(nodo dat)
       {
           int n=13,o=24;
           if(dat==null) return;
           if(dat.edad&amp;gt;n &amp;amp; dat.edad&amp;lt;o){
           jove=jove+1;}
           conjove(dat.next);
       }

        public void conadul(nodo dat)
       {
           int n=24;
           if(dat==null) return;
           if(dat.edad&amp;gt;=n){
           adul=adul+1;}
           conadul(dat.next);
       }

       public void totalhom(nodo dat)
       {
           if(dat==null) return;
           if(dat.sex.equals(&quot;masculino&quot;)){
           thom=thom+1;}
           totalhom(dat.next);
       }

       public void totalmuj(nodo dat)
       {
           if(dat==null) return;
           if(dat.sex.equals(&quot;femenino&quot;)){
           tmuj=tmuj+1;}
           totalmuj(dat.next);
       }

       public void conteo(){
           contotal(primero);
           conniño(primero);
           conjove(primero);
           conadul(primero);
           totalhom(primero);
           totalmuj(primero);
           proniños=niños/tnodos;
           projove=jove/tnodos;
           pronadul=adul/tnodos;
           pronhom=thom/tnodos;
           promuj=tmuj/tnodos;
           System.out.println(&quot;El Porcentaje:
\nDe niños es: &quot;+proniños+&quot;\nDe jovenes:&quot;+projove+&quot;\nDe adultos: &quot;+pronadul+&quot;\nDe hombres: &quot;+pronhom+&quot;\nDe mujeres:&quot;+promuj);
       }

}&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;b&gt;Clase Main&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:java&quot;&gt;public class Main {

    public static void main(String[] args) {
       java.util.Scanner leer=new java.util.Scanner(System.in);
        pacientes x=new pacientes();
        int z;
        System.out.print(&quot;Ingrese el numero de Pacientes a capturar: &quot;);
        z=leer.nextInt();
        for(int i=1;i&amp;lt;=z;i++){
        String n,s,b;int e,t;
        System.out.println(&quot;Ingrese Nombre de Paciente Numero &quot;+i+&quot;:  &quot;);
        n=leer.next();
        System.out.println(&quot;Ingrese Sexo: &quot;);
        s=leer.next();
        System.out.println(&quot;Ingrese Domicilio: &quot;);
        b=leer.next();
        System.out.println(&quot;Ingrese Edad: &quot;);
        e=leer.nextInt();
        System.out.println(&quot;Ingrese Numero Telefonico: &quot;);
        t=leer.nextInt();
        x.alta(n,s,b,e,t);
        }
        System.out.println(&quot;\nLista de General de Pacientes:&quot;);
     x.listanombres();
        System.out.println(&quot;Estadisticas&quot;);
        x.conteo();
    }

}&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://cosasparafuturosingenieros.blogspot.com/feeds/4179942723891287030/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/11/codigo-fuente-java-programa-para.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/4179942723891287030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/4179942723891287030'/><link rel='alternate' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/11/codigo-fuente-java-programa-para.html' title='Código Fuente Java: Programa para Inventario de Pacientes'/><author><name>Diego Agustín Moreno</name><uri>http://www.blogger.com/profile/16423070987153712849</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-LQ7aB6yKZ3E68XnjxSrKHMo0pXCtNPZ_7VwvrbhW75Sf7RGVLneoBz-gf5BicW_xYxwcOV4wpHWHleH17UiojkOc20ONOqGr5pcf5o8wvXxHvoBQp69WkWNDotkRw/s113/damv.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6872164117673495836.post-7129283436832810878</id><published>2012-11-11T13:38:00.000-06:00</published><updated>2013-07-11T16:16:06.499-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="progrmacion en java código fuente java jcreator arbor binario en jaja netbeans estructura de datos en java"/><title type='text'>Código Fuente Java: Suma de Elementos de un Árbol Binario</title><content type='html'>&lt;br /&gt;
Este programa, es un&amp;nbsp;árbol&amp;nbsp;binario, que llenamos con&amp;nbsp;números&amp;nbsp;aleatorios a&amp;nbsp;través&amp;nbsp;de la&amp;nbsp;función&amp;nbsp;random, y realizamos un&amp;nbsp;recorrido&amp;nbsp;del&amp;nbsp;árbol&amp;nbsp;al mismo tiempo que vamos sumando sus elementos y almacenando el resultado en una variable para que posteriormente sea imprimida.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
El programa esta constituido como lo han hecho los anteriores, una clase nodo, una clase&amp;nbsp;árbol&amp;nbsp; y una clase main.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;El programa en&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;-webkit-transition: color 0.3s; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; outline: none; text-decoration: initial;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;&amp;nbsp;esta compilado en&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/NetBeans&quot; style=&quot;-webkit-transition: color 0.3s; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; outline: none; text-decoration: initial;&quot; target=&quot;_blank&quot;&gt;NetBeans&lt;/a&gt;, que si no lo tienes te recomiendo que lo descargues&amp;nbsp;&lt;a href=&quot;http://netbeans.org/downloads/index.html&quot; style=&quot;-webkit-transition: color 0.3s; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; outline: none; text-decoration: initial;&quot; target=&quot;_blank&quot;&gt;aquí&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; margin: 0px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: transparent; font-size: 14px; line-height: 19px;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;Código&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp;Fuente en Java de nuestro programa:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;Clase Nodo&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:java&quot;&gt;
class nodo
{
    int dato;
    nodo der;
    nodo izq;
    nodo(int dat)
    {
        this.dato=dat;
        this.der=null;
        this.izq=null;
    }
}
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;Clase Arbol&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:java&quot;&gt;
public class arbol
{
    nodo raiz=null;
    public boolean tieneraiz()
    {
        if(raiz==null) return false;
        else return true;
    }

    public arbol alta(int dat)
    {
        if(!tieneraiz())
        {
            nodo nuevo=new nodo(dat);
            raiz=nuevo;
        }
        else
        {
            boolean izq;
            nodo actual=raiz;
            while(true)
            {
                if(actual.dato&amp;#60;dat) izq=false;
                else izq=true;
                if(!izq)
                {
                    if(actual.der==null)
                    {
                        nodo nuevo=new nodo(dat);
                        actual.der=nuevo;
                        break;
                    }
                    else actual=actual.der;
                }
                else
                {
                    if(actual.izq==null)
                    {
                        nodo nuevo=new nodo(dat);
                        actual.izq=nuevo;
                        break;
                    }
                    else actual=actual.izq;
                }
            }
        }return this;
    }

    public void imprimir()
    {
        ayudantePreorden(raiz);
    }

    public void ayudantePreorden(nodo dat)
    {
        if(dat==null)
                return;
        System.out.printf(&quot;%d &quot;,dat.dato);
        ayudantePreorden(dat.der);
        ayudantePreorden(dat.izq);
    }

    public void mayor()
 {
  nodo actual;
  actual=raiz;
  while(actual.der!=null)
  {
   actual=actual.der;
  }
                System.out.println(actual.dato);

 }

    int suma,sumader,sumaizq,aux=0;

    public void ayudantesuma(nodo dat)
    {
        if(dat==null)
                return;
        suma=aux+dat.dato;
        aux=suma;
        ayudantesuma(dat.der);
        ayudantesuma(dat.izq);
    }
    public void sumaizquierda()
    {
        nodo dat=raiz;
        ayudantesuma(dat.der);
        sumaizq=suma;
        System.out.println(sumaizq);

    }

    public void sumaderecha()
    {
        aux=0;
        nodo dat=raiz;
        ayudantesuma(dat.izq);
        sumader=suma;
        System.out.println(sumader);

    }
    public void media()
    {
        double media,s1,s2,s3;
        s1=(double)(sumaizq);s2=(double)(sumader);s3=(double)(raiz.dato);
        media=(s1+s2+s3)/10;
        System.out.println(&quot;La media es: \n&quot;+media);
    }
}
&lt;/pre&gt;

&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;Clase Main&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:java&quot;&gt;
public class Main {

    
    public static void main(String[] args) {
       int[] a=new int[10];
       for(int i=0;i&amp;#60;=9;i++)
           a[i]=(int)(Math.random()*50);
       arbol x = new arbol();
       for(int i=0;i&amp;#60;10;i++)
           x.alta(a[i]);
       System.out.println(&quot;Los datos son: &quot;);
       x.imprimir();
       System.out.println(&quot;\nEl numero mayor es: &quot;);
       x.mayor();
       System.out.println(&quot;La suma de los numeros de la Izquierda es: &quot;);
       x.sumaizquierda();
       System.out.println(&quot;La suma de los numeros de la Derecha es: &quot;);
       x.sumaderecha();
       x.media();
    }

}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://cosasparafuturosingenieros.blogspot.com/feeds/7129283436832810878/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/11/codigo-fuente-java-suma-de-elementos-de.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/7129283436832810878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/7129283436832810878'/><link rel='alternate' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/11/codigo-fuente-java-suma-de-elementos-de.html' title='Código Fuente Java: Suma de Elementos de un Árbol Binario'/><author><name>Diego Agustín Moreno</name><uri>http://www.blogger.com/profile/16423070987153712849</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-LQ7aB6yKZ3E68XnjxSrKHMo0pXCtNPZ_7VwvrbhW75Sf7RGVLneoBz-gf5BicW_xYxwcOV4wpHWHleH17UiojkOc20ONOqGr5pcf5o8wvXxHvoBQp69WkWNDotkRw/s113/damv.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6872164117673495836.post-7766312641342105331</id><published>2012-11-11T13:11:00.000-06:00</published><updated>2013-07-11T16:20:37.886-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="arbor binario en jaja"/><category scheme="http://www.blogger.com/atom/ns#" term="código fuente java"/><category scheme="http://www.blogger.com/atom/ns#" term="estructura de datos en java"/><category scheme="http://www.blogger.com/atom/ns#" term="jcreator"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="progrmacion en java"/><title type='text'>Código Fuente Java: Programa Árbol Binario</title><content type='html'>&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 13px; line-height: 19.200000762939453px;&quot;&gt;Un&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: white; font-size: 13px; line-height: 19.200000762939453px;&quot;&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/%C3%81rbol_binario&quot; target=&quot;_blank&quot;&gt;árbol binario&lt;/a&gt;&lt;/b&gt;&lt;span style=&quot;background-color: white; font-size: 13px; line-height: 19.200000762939453px;&quot;&gt;&amp;nbsp;es una&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Estructura_de_datos&quot; style=&quot;background-color: white; background-image: none; font-size: 13px; line-height: 19.200000762939453px; text-decoration: initial;&quot; title=&quot;Estructura de datos&quot;&gt;estructura de datos&lt;/a&gt;&lt;span style=&quot;background-color: white; font-size: 13px; line-height: 19.200000762939453px;&quot;&gt;&amp;nbsp;en la cual cada nodo siempre tiene un hijo izquierdo y un hijo derecho. No pueden tener más de dos hijos (de ahí el nombre &quot;binario&quot;). Si algún hijo tiene como referencia a&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: white; font-size: 13px; line-height: 19.200000762939453px;&quot;&gt;null&lt;/b&gt;&lt;span style=&quot;background-color: white; font-size: 13px; line-height: 19.200000762939453px;&quot;&gt;, es decir que no almacena ningún dato, entonces este es llamado un nodo externo. En el caso contrario el hijo es llamado un nodo interno. Usos comunes de los árboles binarios son los&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/%C3%81rbol_binario_de_b%C3%BAsqueda&quot; style=&quot;background-color: white; background-image: none; font-size: 13px; line-height: 19.200000762939453px; text-decoration: initial;&quot; title=&quot;Árbol binario de búsqueda&quot;&gt;árboles binarios de búsqueda&lt;/a&gt;&lt;span style=&quot;background-color: white; font-size: 13px; line-height: 19.200000762939453px;&quot;&gt;, los&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Mont%C3%ADculo_binario&quot; style=&quot;background-color: white; background-image: none; font-size: 13px; line-height: 19.200000762939453px; text-decoration: initial;&quot; title=&quot;Montículo binario&quot;&gt;montículos binarios&lt;/a&gt;&lt;span style=&quot;background-color: white; font-size: 13px; line-height: 19.200000762939453px;&quot;&gt;&amp;nbsp;y&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://es.wikipedia.org/wiki/Codificaci%C3%B3n_de_Huffman&quot; style=&quot;background-color: white; background-image: none; font-size: 13px; line-height: 19.200000762939453px; text-decoration: initial;&quot; title=&quot;Codificación de Huffman&quot;&gt;Codificación de Huffman&lt;/a&gt;&lt;span style=&quot;background-color: white; font-size: 13px; line-height: 19.200000762939453px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;El programa &amp;nbsp;esta construido de la siguiente manera: consta de 3 clases, una llamada nodo donde alojamos la estructura de nuestro arbol, otra llamada&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;arbol&lt;/span&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;donde escribimos los&amp;nbsp;métodos&amp;nbsp;que manipulan a este, y una ultima llamada&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Main que alojara al método principal de nuestro programa que se encargara de controlar todo el programa.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;El programa en&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;-webkit-transition: color 0.3s; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; outline: none; text-decoration: initial;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;&amp;nbsp;esta compilado en&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/NetBeans&quot; style=&quot;-webkit-transition: color 0.3s; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; outline: none; text-decoration: initial;&quot; target=&quot;_blank&quot;&gt;NetBeans&lt;/a&gt;, que si no lo tienes te recomiendo que lo descargues&amp;nbsp;&lt;a href=&quot;http://netbeans.org/downloads/index.html&quot; style=&quot;-webkit-transition: color 0.3s; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; outline: none; text-decoration: initial;&quot; target=&quot;_blank&quot;&gt;aquí&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;Aquí&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp;el &amp;nbsp;código&amp;nbsp;fuente de nuestro programa en Java:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;b&gt;Clase Nodo&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:java&quot;&gt;
class nodo
{
    int dato;
    nodo der;
    nodo izq;
    nodo(int dat)
    {
        this.dato=dat;
        this.der=null;
        this.izq=null;
    }
}
&lt;/pre&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;b&gt;Clase Arbol&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:java&quot;&gt;
public class arbol
{
    nodo raiz=null;
    public boolean tieneraiz()
    {
        if(raiz==null) return false;
        else return true;
    }

    public arbol alta(int dat)
    {
        if(!tieneraiz())
        {
            nodo nuevo=new nodo(dat);
            raiz=nuevo;
        }
        else
        {
            boolean izq;
            nodo actual=raiz;
            while(true)
            {
                if(actual.dato&amp;#60;dat) izq=false;
                else izq=true;
                if(!izq)
                {
                    if(actual.der==null)
                    {
                        nodo nuevo=new nodo(dat);
                        actual.der=nuevo;
                        break;
                    }
                    else actual=actual.der;
                }
                else
                {
                    if(actual.izq==null)
                    {
                        nodo nuevo=new nodo(dat);
                        actual.izq=nuevo;
                        break;
                    }
                    else actual=actual.izq;
                }
            }
        }return this;
    }

    public boolean baja(int dat)
    {
        nodo actual=raiz, anterior=raiz, temp;
        while(true)
        {
            if(actual==null) break;
            if(actual.dato==dat) break;
            anterior=actual;
            if(actual.dato&amp;#60;dat) actual=actual.der;
            else actual=actual.der;
        }
        if(actual==null) return false;
        else
        {
            if(actual==raiz)
            {
                temp=actual.izq;
                raiz=raiz.der;
                anterior=raiz;
            }
            else
            if (anterior.der == actual)
            {
                temp=actual.izq;
                anterior=actual.der;
            }
            else
            {
             temp=actual.izq;
             anterior.der=actual.izq;
            }
            actual=new nodo();
            while(actual.izq!=null)
                actual=actual.izq;
            actual.izq=temp;
            return true;
        }
    }

    public void imprimirpreorden()
    {
        ayudantePreorden(raiz);
    }

    public void ayudantePreorden(nodo dat)
    {
        if(dat==null)
                return;
        System.out.printf(&quot;%d &quot;,dat.dato);
        ayudantePreorden(dat.der);
        ayudantePreorden(dat.izq);
    }

    public void impririnorden(nodo dat)
    {
        if(dat!=null)
        {
            impririnorden(dat.izq);
            System.out.println(&quot; &quot;+dat.dato);
            impririnorden(dat.der);
        }
    }
}
&lt;/pre&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;b&gt;Clase Main&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:java&quot;&gt;

public class Main {

   
    public static void main(String[] args) {
        java.util.Scanner leer=new java.util.Scanner(System.in);
        arbol x=new arbol();
        int z;
        System.out.print(&quot;Ingrese el numero de Datos a capturar: &quot;);
        z=leer.nextInt();
        for(int i=1; i&amp;#60;=z;i++){
        int m;
        System.out.println(&quot;Ingrese Dato &quot;+i+&quot;:  &quot;);m=leer.nextInt();
        x.alta(m);
        }
        System.out.println(&quot;Valores Capturados en PreOrden:&quot;);
     x.imprimirpreorden();
        int q;
        System.out.print(&quot;\nIngrese dato a borrar: &quot;);q=leer.nextInt();
     x.baja(q);
        System.out.println(&quot;\nDespues de borrar el dato &quot;+q+&quot; :&quot;);
     x.imprimir();
    }

}
&lt;/pre&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cosasparafuturosingenieros.blogspot.com/feeds/7766312641342105331/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/11/codigo-fuente-java-programa-arbol.html#comment-form' title='18 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/7766312641342105331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/7766312641342105331'/><link rel='alternate' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/11/codigo-fuente-java-programa-arbol.html' title='Código Fuente Java: Programa Árbol Binario'/><author><name>Diego Agustín Moreno</name><uri>http://www.blogger.com/profile/16423070987153712849</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-LQ7aB6yKZ3E68XnjxSrKHMo0pXCtNPZ_7VwvrbhW75Sf7RGVLneoBz-gf5BicW_xYxwcOV4wpHWHleH17UiojkOc20ONOqGr5pcf5o8wvXxHvoBQp69WkWNDotkRw/s113/damv.png'/></author><thr:total>18</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6872164117673495836.post-7722861672021967382</id><published>2012-11-11T02:16:00.000-06:00</published><updated>2013-07-11T16:21:53.407-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="condigo fuente en java"/><category scheme="http://www.blogger.com/atom/ns#" term="jcreator"/><category scheme="http://www.blogger.com/atom/ns#" term="lista circular doble"/><category scheme="http://www.blogger.com/atom/ns#" term="lista circular doblemente ligada"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="progrmacion en java"/><title type='text'>Código Fuente Java: Programa de Lista Circular Doble</title><content type='html'>&lt;div&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;Entre una Lista Doblemente Ligada (o Lista Doble) y una Lista Circular Doblemente Ligada (o Lista Circular doble) la diferencia es&amp;nbsp;mínima.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;La variante seria que ahora el elemento final de nuestra lista, que en este caso se llama ultimo, ya no&amp;nbsp;apuntaría&amp;nbsp;hacia NULL, sino que ahora se&amp;nbsp;enlazaría&amp;nbsp;hacia el elemento inicio, creando&amp;nbsp;así&amp;nbsp;un lasta circular.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;El&amp;nbsp;método&amp;nbsp;de&amp;nbsp;construcción&amp;nbsp;de nuestro programa &amp;nbsp;es similar a al usado en las listas anteriores, es decir, consta de 3 clases, una llamada nodo donde alojamos la estructura de nuestra lista, otra llamada&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;listacirculardoble&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp;donde escribimos los&amp;nbsp;métodos&amp;nbsp;que manipularan nuestra lista, y una ultima llamada&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;Mainlistacirculardoble que alojara al método principal de nuestro programa que se encargara de controlar la lista completa.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;El programa en&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;-webkit-transition: color 0.3s; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; outline: none; text-decoration: initial;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;&amp;nbsp;esta compilado en&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/NetBeans&quot; style=&quot;-webkit-transition: color 0.3s; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; outline: none; text-decoration: initial;&quot; target=&quot;_blank&quot;&gt;NetBeans&lt;/a&gt;, que si no lo tienes te recomiendo que lo descargues&amp;nbsp;&lt;a href=&quot;http://netbeans.org/downloads/index.html&quot; style=&quot;-webkit-transition: color 0.3s; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; outline: none; text-decoration: initial;&quot; target=&quot;_blank&quot;&gt;aquí&lt;/a&gt;.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; text-align: justify;&quot; /&gt;&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;Bueno para lo alagar demasiado la entrada a&amp;nbsp;continuación&amp;nbsp;el Programa:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;b&gt;Clase Nodo&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:java&quot;&gt;
class nodo
{
 int dato;
 nodo next;
 nodo ant;
 nodo(int a)
 {
  dato=a;
  ant=null;
  next=null;
 }
}
&lt;/pre&gt;
&lt;div&gt;

&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;b&gt;Clase listacirculardoble&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:java&quot;&gt;
public class listacirculardoble
{
 nodo primero;
 nodo ultimo;
 
 listacirculardoble()
 {
  primero=null;
  ultimo=null;
 }
 
 public boolean estavacio()
 {
  if(primero==null) return true;
  else return false;
 }
 
    public listacirculardoble alta(int dat)
    {
     if(estavacio())
     {
      nodo nuevo=new nodo(dat);
      primero=nuevo;
      ultimo=nuevo;
      nuevo.next=nuevo;
      nuevo.ant=nuevo;
     }
     else
     {
      nodo nuevo=new nodo(dat);
      ultimo.next=nuevo;
      nuevo.ant=ultimo;
      primero.ant=nuevo;
      nuevo.next=primero;
      ultimo=nuevo;
     }
     return this;
    }
    
    public boolean bajaxposicion(int dat)
    {
     nodo actual=primero;
     nodo anterior;
     nodo siguiente;
     for(int i=0;i&amp;#60;=dat;i++)
     {
      if(actual==ultimo)
      {
       if(i&amp;#60;dat) return false;
       else
       {
        if(i==dat)
        {
         anterior=actual.ant;
         anterior.next=primero;
         primero.ant=anterior;
         ultimo=anterior;
         return true;
        }
        
       }
      
      }
      else
      {
       if(dat==0)
       {
        siguiente=actual.next;
        siguiente.ant=ultimo;
        ultimo.next=siguiente;
        primero=siguiente;
        return true;
       }
       if(dat==i)
       {
        anterior=actual.ant;
        siguiente=actual.next;
        anterior.next=siguiente;
        siguiente.ant=anterior;
        return true;
       }
      }
      actual=actual.next;
     }
     return false;
    }
    
    
    public void imprimir()
 {
  nodo actual;
  actual=primero;
  while(actual!=ultimo)
  {
   System.out.println(actual.dato);
   actual=actual.next;
  }
        System.out.println(actual.dato);
                
 }
    
}
&lt;/pre&gt;


&lt;div&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;b&gt;Clase&amp;nbsp;Mainlistacirculardoble&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:java&quot;&gt;
public class Mainlistacirculardoble {

    public static void main(String[]args)
    {
     listacirculardoble x=new listacirculardoble();
     int a=5;
     int b=10;
     int c=15;
     int d=20;
     int e=25;
     int f=30;
     x.alta(a);
     x.alta(b);
     x.alta(c);
     x.alta(d);
     x.alta(e);
     x.alta(f);
     System.out.println(&quot;Valores iniciales:\n&quot;);
     x.imprimir();
     x.bajaxposicion(0);
     System.out.println(&quot;\nDespues de borrar la Posicion 3:\n&quot;);
     x.imprimir();
    }
}
&lt;/pre&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cosasparafuturosingenieros.blogspot.com/feeds/7722861672021967382/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/11/codigo-fuente-java-programa-de-lista.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/7722861672021967382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/7722861672021967382'/><link rel='alternate' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/11/codigo-fuente-java-programa-de-lista.html' title='Código Fuente Java: Programa de Lista Circular Doble'/><author><name>Diego Agustín Moreno</name><uri>http://www.blogger.com/profile/16423070987153712849</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-LQ7aB6yKZ3E68XnjxSrKHMo0pXCtNPZ_7VwvrbhW75Sf7RGVLneoBz-gf5BicW_xYxwcOV4wpHWHleH17UiojkOc20ONOqGr5pcf5o8wvXxHvoBQp69WkWNDotkRw/s113/damv.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6872164117673495836.post-7973125620743162446</id><published>2012-11-09T22:17:00.000-06:00</published><updated>2013-07-11T16:27:10.786-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".java"/><category scheme="http://www.blogger.com/atom/ns#" term="agregar"/><category scheme="http://www.blogger.com/atom/ns#" term="alta"/><category scheme="http://www.blogger.com/atom/ns#" term="baja"/><category scheme="http://www.blogger.com/atom/ns#" term="código"/><category scheme="http://www.blogger.com/atom/ns#" term="código fuente"/><category scheme="http://www.blogger.com/atom/ns#" term="código java"/><category scheme="http://www.blogger.com/atom/ns#" term="doblemente enlazada"/><category scheme="http://www.blogger.com/atom/ns#" term="informática"/><category scheme="http://www.blogger.com/atom/ns#" term="ingeniería"/><category scheme="http://www.blogger.com/atom/ns#" term="ingeniería en computación"/><category scheme="http://www.blogger.com/atom/ns#" term="jcreator"/><category scheme="http://www.blogger.com/atom/ns#" term="lista doble"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="nodos"/><category scheme="http://www.blogger.com/atom/ns#" term="sistemas"/><title type='text'>[Código Fuente JAVA]: Lista Doble Agregar, Quitar e Impresión </title><content type='html'>&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Ahora es el turno de las listas doblemente enlazadas. Este tipo de listas se diferencian de las&amp;nbsp;simples&amp;nbsp;en que, ahora cada nodo ademas de contener la un enlace a la&amp;nbsp;dirección&amp;nbsp;siguiente,&amp;nbsp;tendrá&amp;nbsp;una con la&amp;nbsp;dirección&amp;nbsp;del nodo anterior al actual.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;La ventaja que nos proporciona este tipo de lista es que podemos recorrer la lista desde el nodo&amp;nbsp;inicial&amp;nbsp;al final y desde el final a el inicial.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Este programa esta dividido en 3 clases, clase nodo, clase listasdobles, y la clase principal main que contiene al&amp;nbsp;método&amp;nbsp;principal. dentro de la clase&amp;nbsp;nodo&amp;nbsp;se declara la estructura de la lista y dentro de la clase listasdobles encontramos el&amp;nbsp;método&amp;nbsp;agregar, borrar, imprimir de inicio a fin e imprimir de fin a inicio.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;El programa en&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; line-height: 19px; outline: none; text-align: justify; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;&amp;nbsp;&amp;nbsp;esta compilado en&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/NetBeans&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; line-height: 19px; outline: none; text-align: justify; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;NetBeans&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;, que si no lo tienes te recomiendo que lo descargues&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://netbeans.org/downloads/index.html&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; line-height: 19px; outline: none; text-align: justify; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;aquí&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;&lt;b&gt;El código de la clase nodo :&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;class nodo
{
	int dato;
	nodo next;
	nodo ant;
	nodo(int a)
	{
		this.dato=a;
		this.next=null;
		this.ant=null;
	}
}&lt;/pre&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;&lt;b&gt;El código de la clase listadobles :&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;public class listasdobles
{
	nodo primero;
	nodo ultimo;
	listasdobles()
	{
		primero=null;
		ultimo=null;
	}

	public boolean estavacio()
	{
		if(primero==null) return true;
		else return false;
	}

	public listasdobles alta(int dat)
	{
		if(estavacio())
		{
			nodo nuevo=new nodo(dat);
			primero=nuevo;
			ultimo=nuevo;
		}
		else
		{
			nodo nuevo=new nodo(dat);
			ultimo.next=nuevo;
			nuevo.ant=ultimo;
			ultimo=nuevo;
		}
		return this;
	}

	public listasdobles borrar(int a)
	{
		nodo w=primero;
		nodo y;
		for(int i=0;i&amp;lt;a;i++)
		{
			y=w.ant;
			w=w.next;
		}
		y=w.ant;
		return this;
	}

	public boolean delete(int num)
	{
		nodo anterior=null;
		nodo actual=primero;
		while(actual!=ultimo)
		{
			if(actual.dato==num)
			{
				if(anterior==null)
				{
					primero=actual.next;
					primero.ant=null;
				}
				else{
					anterior.next=actual.next;
					nodo temporal;
					temporal=actual.next;
					temporal.ant=anterior;
				}
				return true;
			}
			anterior=actual;
			actual=actual.next;
		}
		if(num==ultimo.dato)
		{
			ultimo=actual.ant;
			return true;
		}
		return false;
	}

        public void imprimir2()
	{
		nodo actual;
		actual=ultimo;
		while(actual!=primero)
		{
			System.out.println(actual.dato);
			actual=actual.ant;
		}
                System.out.println(actual.dato);

	}
        public void imprimir()
	{
		nodo actual;
		actual=primero;
		while(actual!=ultimo)
		{
			System.out.println(actual.dato);
			actual=actual.next;
		}
                System.out.println(actual.dato);
                
	}
}&lt;/pre&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;&lt;b&gt;El código de la clase Main :&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 19px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;public class Main {    
    public static void main(String[] args) {
       int b=5;
       int c=10;
       int d=15;
       int e=20;
       int f=25;
       listasdobles a=new listasdobles();
       a.alta(b);
       a.alta(c);
       a.alta(d);
       a.alta(e);
       a.alta(f);
       a.imprimir2();
       a.delete(25);
       a.imprimir2();
    }
}
&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://cosasparafuturosingenieros.blogspot.com/feeds/7973125620743162446/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/11/codigo-fuente-java-lista-doble-agregar.html#comment-form' title='12 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/7973125620743162446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/7973125620743162446'/><link rel='alternate' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/11/codigo-fuente-java-lista-doble-agregar.html' title='[Código Fuente JAVA]: Lista Doble Agregar, Quitar e Impresión '/><author><name>Diego Agustín Moreno</name><uri>http://www.blogger.com/profile/16423070987153712849</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-LQ7aB6yKZ3E68XnjxSrKHMo0pXCtNPZ_7VwvrbhW75Sf7RGVLneoBz-gf5BicW_xYxwcOV4wpHWHleH17UiojkOc20ONOqGr5pcf5o8wvXxHvoBQp69WkWNDotkRw/s113/damv.png'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6872164117673495836.post-2792561725709026165</id><published>2012-10-13T19:08:00.000-05:00</published><updated>2013-07-11T16:27:58.916-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="agregar"/><category scheme="http://www.blogger.com/atom/ns#" term="alta"/><category scheme="http://www.blogger.com/atom/ns#" term="baja"/><category scheme="http://www.blogger.com/atom/ns#" term="computación"/><category scheme="http://www.blogger.com/atom/ns#" term="código fuente"/><category scheme="http://www.blogger.com/atom/ns#" term="código java"/><category scheme="http://www.blogger.com/atom/ns#" term="imprimir"/><category scheme="http://www.blogger.com/atom/ns#" term="informática"/><category scheme="http://www.blogger.com/atom/ns#" term="ingeniería"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="jcreator"/><category scheme="http://www.blogger.com/atom/ns#" term="lista"/><category scheme="http://www.blogger.com/atom/ns#" term="lista sencilla"/><category scheme="http://www.blogger.com/atom/ns#" term="lista simple"/><category scheme="http://www.blogger.com/atom/ns#" term="metodos"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="nodos"/><category scheme="http://www.blogger.com/atom/ns#" term="quitar"/><category scheme="http://www.blogger.com/atom/ns#" term="sistemas"/><title type='text'>[Código Fuente JAVA]: Lista Simple Agregar, Quitar e Impresión </title><content type='html'>&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Este&amp;nbsp;código&amp;nbsp;es similar al anterior con la diferencia de que en este implementamos un nuevo&amp;nbsp;método&amp;nbsp; baja, el cual se encarga de quitar nodos de nuestra lista.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Podemos notar&amp;nbsp;también&amp;nbsp;que la estructura declarada en la clase nodo esta vez cuanta con mas elementos, lo que significa que podremos guardar mas&amp;nbsp;información&amp;nbsp;dentro de cada nodo de nuestra lista.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;El programa en&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; line-height: 19px; outline: none; text-align: justify; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;&amp;nbsp;&amp;nbsp;esta compilado en&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/NetBeans&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; line-height: 19px; outline: none; text-align: justify; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;NetBeans&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;, que si no lo tienes te recomiendo que lo descargues&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://netbeans.org/downloads/index.html&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; line-height: 19px; outline: none; text-align: justify; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;aquí&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;Esta&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Entorno_de_desarrollo_integrado&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; line-height: 19px; outline: none; text-align: justify; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;IDE&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;&amp;nbsp;(en español&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;Entorno de Desarrollo Integrado&lt;/i&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;&amp;nbsp;o en&amp;nbsp;ingles&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;integrated development environment&lt;/i&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;&amp;nbsp;), te hace mas amigable la vista del&amp;nbsp;código, ademas de que te van indicando los errores casi&amp;nbsp;simultáneamente&amp;nbsp;a la escritura. Otra de sus ventajas es que facilita el desarrollo de una&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Interfaz_gr%C3%A1fica_de_usuario&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; line-height: 19px; outline: none; text-align: justify; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;GUI&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;&amp;nbsp;(Interfaz&amp;nbsp;Gráfica&amp;nbsp;de Usuario).&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; line-height: 19px; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;El&amp;nbsp;código&amp;nbsp;fuente java:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;b&gt;Clase prog&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;class Nodo
{
 int id;
 String nom;
 int tel;
 Nodo next;
 Nodo(int _id, String _nom, int _tel)
 {
  this.id=_id;
  this.nom=_nom;
  this.tel=_tel;
  this.next=null;
 }
}

public class prog
{

    Nodo primero;
    Nodo ultimo;
    prog()
    {
     primero=null;
     ultimo=null;
    }
    public boolean estavacio()
    {
     if(primero==null)return true;
     else return false;
    }
    public prog alta(int _id, String _nom, int _tel)
    {
     if(estavaio())
     {
      Nodo nuevo=new Nodo(int _id, String _nom, int _tel);
      primero=nuevo;
      ultimo=nuevo;
     }
     else
     {
      Nodo nuevo=new Nodo(int _id, String _nom, int _tel);
      ultimo.next=nuevo;
      ultimo=nuevo;
     }
     return this;
    }
    public boolean baja(int _id)
    {
     Nodo anterior=null;
     Nodo actual=primero;
     while(actual!=ultimo)
     {
      if(actual id==_id)
      {
       if(anterior==null)
       {
        primero=actual.next;
       }
       else
       {
        if(actual.next==null) ultimo=anterior;
        else anterior.next=actual.next;
       }
       return true;
      }
      anterior=actual;
      actual=actual.next;
     }
     return false;
    }
    public void imprimir()
    {
      nodo actual;
      actual=primero;
      while(actual!=ultimo)
      {
       System.out.println(actual.dato);
       actual=actual.next;
      }
    }
    public static void main(String[]args)
    {
     int a;
     String b;
     int c;
     prog d=new prog();
     Sytem.out.println(&quot;Por favor indique su ID: &quot;);
     a=sc.nextInt();
    
    }
}
&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://cosasparafuturosingenieros.blogspot.com/feeds/2792561725709026165/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/10/este-similar-al-anterior-con-la.html#comment-form' title='1 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/2792561725709026165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/2792561725709026165'/><link rel='alternate' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/10/este-similar-al-anterior-con-la.html' title='[Código Fuente JAVA]: Lista Simple Agregar, Quitar e Impresión '/><author><name>Diego Agustín Moreno</name><uri>http://www.blogger.com/profile/16423070987153712849</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-LQ7aB6yKZ3E68XnjxSrKHMo0pXCtNPZ_7VwvrbhW75Sf7RGVLneoBz-gf5BicW_xYxwcOV4wpHWHleH17UiojkOc20ONOqGr5pcf5o8wvXxHvoBQp69WkWNDotkRw/s113/damv.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6872164117673495836.post-2203253832985732954</id><published>2012-10-13T18:37:00.000-05:00</published><updated>2012-10-13T18:57:09.813-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".java"/><category scheme="http://www.blogger.com/atom/ns#" term="agregar"/><category scheme="http://www.blogger.com/atom/ns#" term="beans"/><category scheme="http://www.blogger.com/atom/ns#" term="codigo"/><category scheme="http://www.blogger.com/atom/ns#" term="fuente"/><category scheme="http://www.blogger.com/atom/ns#" term="imprimir"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="jcreator"/><category scheme="http://www.blogger.com/atom/ns#" term="lista"/><category scheme="http://www.blogger.com/atom/ns#" term="lista simple"/><category scheme="http://www.blogger.com/atom/ns#" term="metodos"/><category scheme="http://www.blogger.com/atom/ns#" term="net"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="recorrido"/><category scheme="http://www.blogger.com/atom/ns#" term="sencilla"/><title type='text'>[Código Fuente JAVA]: Lista Simple Agregar e Impresion</title><content type='html'>&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;Este pequeño&amp;nbsp;programa&amp;nbsp;en java nos&amp;nbsp;permitirá&amp;nbsp;crear una lista simple, la cual solo tiene un enlace apuntando hacia&amp;nbsp;la siguiente&amp;nbsp;dirección&amp;nbsp;de memoria.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;Usaremos una clase llamada nodo donde se declara la&amp;nbsp;estructura&amp;nbsp;de la lista, que en este caso&amp;nbsp;contendrá&amp;nbsp;un dato y un la&amp;nbsp;dirección&amp;nbsp;siguiente.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;


&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;Dentro del&amp;nbsp;código&amp;nbsp;tenemos dos&amp;nbsp;métodos: agregarnodo e imprimir, ademas de el&amp;nbsp;método&amp;nbsp;principal Main.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; text-align: justify;&quot;&gt;El programa en&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; outline: none; text-align: justify; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; text-align: justify;&quot;&gt;&amp;nbsp;&amp;nbsp;esta compilado en&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/NetBeans&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; outline: none; text-align: justify; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;NetBeans&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; text-align: justify;&quot;&gt;, que si no lo tienes te recomiendo que lo descargues&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://netbeans.org/downloads/index.html&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; outline: none; text-align: justify; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;aquí&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; text-align: justify;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; text-align: justify;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; text-align: justify;&quot;&gt;Esta&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Entorno_de_desarrollo_integrado&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; outline: none; text-align: justify; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;IDE&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; text-align: justify;&quot;&gt;&amp;nbsp;(en español&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; text-align: justify;&quot;&gt;Entorno de Desarrollo Integrado&lt;/i&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; text-align: justify;&quot;&gt;&amp;nbsp;o en&amp;nbsp;ingles&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;background-color: white; color: #333333; font-family: sans-serif; line-height: 19px; text-align: justify;&quot;&gt;integrated development environment&lt;/i&gt;&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;&amp;nbsp;), te hace mas amigable la vista del&amp;nbsp;código, ademas de que te van indicando los errores casi&amp;nbsp;simultáneamente&amp;nbsp;a la escritura. Otra de sus ventajas es que facilita el desarrollo de una &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Interfaz_gr%C3%A1fica_de_usuario&quot; style=&quot;-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; outline: none; text-align: justify; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;GUI&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; text-align: justify;&quot;&gt;&amp;nbsp;(Interfaz&amp;nbsp;Gráfica&amp;nbsp;de Usuario).&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; text-align: justify;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 19px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;Bueno sin mas que agregar el&amp;nbsp;código:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;&lt;b&gt;Clase Main&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;class nodo
{
 int dato;
 nodo next;
 nodo(int a)
 {
  this.dato=a;
  this.next=null;
 }

}

public class Main {
nodo primero;
 nodo ultimo;
 Main()
        {
  primero=null;
  ultimo=null;
 }
 public boolean estavacio()
 {
  if(primero==null) return true;
  else return false;
 }
    public Main agregarnodo(int dat)
    {
     if(estavacio())
     {
      nodo nuevo=new nodo(dat);
      primero=nuevo;
      ultimo=nuevo;
     }
     else
     {
      nodo nuevo=new nodo(dat);
      ultimo.next=nuevo;
      ultimo=nuevo;
     }
     return this;
    }
     public void imprimir()
      {
      nodo actual;
      actual=primero;
      while(actual!=ultimo)
      {
       System.out.println(actual.dato);
       actual=actual.next;
      }
     }

 public static void main(String[]args)
 {
  int c=1;
  Main a=new Main();
  for(int i=1; i&amp;lt;=10; i++)
  {
   c*=i;
   a.agregarnodo(c);
  }
  a.imprimir();
 }
    

}

&lt;/pre&gt;
&lt;script src=&quot;http://crux-framework-tools.googlecode.com/svn/trunk/misc/highlight/highlightLoader.js&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://cosasparafuturosingenieros.blogspot.com/feeds/2203253832985732954/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/10/codigo-fuente-java-lista-simple-agregar.html#comment-form' title='1 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/2203253832985732954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/2203253832985732954'/><link rel='alternate' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/10/codigo-fuente-java-lista-simple-agregar.html' title='[Código Fuente JAVA]: Lista Simple Agregar e Impresion'/><author><name>Diego Agustín Moreno</name><uri>http://www.blogger.com/profile/16423070987153712849</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-LQ7aB6yKZ3E68XnjxSrKHMo0pXCtNPZ_7VwvrbhW75Sf7RGVLneoBz-gf5BicW_xYxwcOV4wpHWHleH17UiojkOc20ONOqGr5pcf5o8wvXxHvoBQp69WkWNDotkRw/s113/damv.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6872164117673495836.post-8453883314748335935</id><published>2012-06-16T01:27:00.001-05:00</published><updated>2013-07-11T16:30:30.453-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="beans"/><category scheme="http://www.blogger.com/atom/ns#" term="código"/><category scheme="http://www.blogger.com/atom/ns#" term="código fuente"/><category scheme="http://www.blogger.com/atom/ns#" term="código java"/><category scheme="http://www.blogger.com/atom/ns#" term="fibonacci"/><category scheme="http://www.blogger.com/atom/ns#" term="fuente"/><category scheme="http://www.blogger.com/atom/ns#" term="informática"/><category scheme="http://www.blogger.com/atom/ns#" term="ingeniería"/><category scheme="http://www.blogger.com/atom/ns#" term="ingeniería en computación"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="jcreator"/><category scheme="http://www.blogger.com/atom/ns#" term="net"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="series de fibonacci"/><category scheme="http://www.blogger.com/atom/ns#" term="sistemas"/><category scheme="http://www.blogger.com/atom/ns#" term="sucesión de fibonacci"/><title type='text'>Código Fuente Java: La Sucesión de Fibonacci</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
Código&amp;nbsp;Fuente&amp;nbsp;
&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;&amp;nbsp;que&amp;nbsp;resuelve&amp;nbsp;la &lt;a href=&quot;http://es.wikipedia.org/wiki/Sucesi%C3%B3n_de_Fibonacci&quot; target=&quot;_blank&quot;&gt;Sucesión de Fibonacci&lt;/a&gt;&amp;nbsp;a&amp;nbsp;través&amp;nbsp;de la&amp;nbsp;creación&amp;nbsp;de una lista en&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;. Estas Series&amp;nbsp;fueron&amp;nbsp;ideadas por &lt;a href=&quot;http://es.wikipedia.org/wiki/Fibonacci&quot; target=&quot;_blank&quot;&gt;Leonardo de Pisa&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
La&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Sucesi%C3%B3n_de_Fibonacci&quot; target=&quot;_blank&quot;&gt;Sucesión de Fibonacci&lt;/a&gt;&amp;nbsp;inicia con &lt;b&gt;1&lt;/b&gt;&amp;nbsp;y &lt;b&gt;1,&lt;/b&gt;y a partir de&amp;nbsp;ahí&amp;nbsp;cada elemento es la suma de los dos&amp;nbsp;anteriores. Usualmente a los&amp;nbsp;números&amp;nbsp;de esta serie se les conoce como &lt;b&gt;números&amp;nbsp;de Fibonacci&lt;/b&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;EL programa en&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;&amp;nbsp;esta compilado en&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/NetBeans&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;NetBeans&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;, que si no lo tienes te recomiendo que lo descargues&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://netbeans.org/downloads/index.html&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;aquí&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;Esta&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Entorno_de_desarrollo_integrado&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;IDE&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;(en español&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;text-align: justify;&quot;&gt;Entorno de Desarrollo Integrado&lt;/i&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;o en&amp;nbsp;ingles&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19px; text-align: justify;&quot;&gt;integrated development environment&lt;/i&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;), te hace mas amigable la vista del&amp;nbsp;código&amp;nbsp;cuando programas, ademas de que te van indicando los errores casi inmediatamente, otra de sus ventajas es que facilita el desarrollo con&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Interfaz_gr%C3%A1fica_de_usuario&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;GUI&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;(Interfaz&amp;nbsp;Gráfica&amp;nbsp;de Usuario).&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;Este&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;Código&lt;/span&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;Fuente&lt;/span&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;resulta un poco mas complejo que los anteriores&amp;nbsp;aquí&amp;nbsp;vistos, puesto que en este caso controlaremos los&amp;nbsp;métodos&amp;nbsp;de una clase (en este caso la clase&amp;nbsp;
&lt;span style=&quot;text-align: justify;&quot;&gt;lista en&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;) a través de una&amp;nbsp;clase&amp;nbsp;principal( en este caso fibonacci), y por ultimo la clase nodo es la que nos&amp;nbsp;permitirá&amp;nbsp;crear los nodos necesarios en nuestra&amp;nbsp;&lt;span style=&quot;text-align: justify;&quot;&gt;lista en&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Bueno&amp;nbsp;aquí&amp;nbsp;el Código&amp;nbsp;Fuente&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;de la clase nodo:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;pre class=&quot;brush:java&quot;&gt;class nodo
{
      int dato;
      nodo next;
      nodo (int a)
      {
            this.dato=a;
            this.next=null;
      }
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ahora el&amp;nbsp;Código&amp;nbsp;Fuente&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;de la clase lista:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:java&quot;&gt;public class listas
{
      nodo primero;
      nodo ultimo;
      listas()
      {
            primero=null;
            ultimo=null;
      } 

      public boolean estavacio()
      {
            if(primero==null) return true;
            else return false;
      }

      public listas alta(int dat)
      {
            if(estavacio())
            {
                  nodo nuevo=new nodo(dat);
                  primero=nuevo;
                  ultimo=nuevo;
            }
            else
            {
                  nodo nuevo=new nodo(dat);
                  ultimo.next=nuevo;
                  ultimo=nuevo;
            }
            return this;
      }

      public boolean baja(int dat)
      {
            nodo anterior=null;
            nodo actual=primero;
            while(actual!=ultimo)
            {
            if(actual.dato==dat)
                  {
                        if(anterior==null)
                        {
                              primero=actual.next;
                        }
                        else
                        {
                              if(actual.next==null)
                              {
                                    ultimo=anterior;
                              }
                              else
                              {
                                    anterior.next=actual.next;
                              }
                        }
                        return true;
                  }
                  anterior=actual;
                  actual=actual.next;
            }
            return false;
      } 

      public void imprimir()
      {
            nodo actual;
            actual=primero;
            while(actual!=ultimo)
            {
                  if(actual.dato%2==0) System.out.println(actual.dato+&quot; Es par&quot;);
                  else System.out.println(actual.dato+&quot; Es impar&quot;);
                  actual=actual.next;
            }
      } 

       public boolean esprimo(int x)
      {
            int y=1;
            for(int i=2;i&amp;lt;10;i++)
            {
                  y=x%i;
                  if(y!=0) return true;
                  else return false;
            }
            return false;
      }
 
      public void imprimo()
      {
            nodo actual;
            actual=primero;
            while(actual!=ultimo)
            {
                  for (int i=actual.dato; i&amp;gt;=1; i--)
            {
                  if(esprimo(i))
                  {
                        if(i!=actual.dato)
                        {
                              System.out.println(i+&quot;:Es el numero primo inmediato inferior al fibonacci:&quot;+actual.dato);
                              break;
                        }
                  }
            }
            actual=actual.next;   
            }
      }
}

&lt;!--10--&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Y por ultimo&amp;nbsp;el Código&amp;nbsp;Fuente&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;de la clase principal fibonacci:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;pre class=&quot;brush:java&quot;&gt;public class fibanocci {
    public static void main(String[]args)
    {
     listas a=new listas();
     int d=1;
     int b=1;
     int f=0;
     a.alta(d);
     a.alta(b);
     for(int i=0;i&amp;lt;=10;i++)
     {
     f=d+b;
     a.alta(f);
     d=b;
     b=f;
     }
     a.imprimir();
     a.imprimo();
    }
}

&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;Es importante que las tres&amp;nbsp;clases&amp;nbsp;se encuentren en la misma carpeta al momento de compilar y&amp;nbsp;ejecutar&amp;nbsp;el&amp;nbsp;&lt;/code&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;Código&amp;nbsp;Fuente&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;&lt;span style=&quot;text-align: justify;&quot;&gt;que&amp;nbsp;resuelve&amp;nbsp;la&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Sucesi%C3%B3n_de_Fibonacci&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;Sucesión de Fibonacci&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://cosasparafuturosingenieros.blogspot.com/feeds/8453883314748335935/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/06/codigo-java-sucesion-de-fibonacci-la.html#comment-form' title='2 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/8453883314748335935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/8453883314748335935'/><link rel='alternate' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/06/codigo-java-sucesion-de-fibonacci-la.html' title='Código Fuente Java: La Sucesión de Fibonacci'/><author><name>Diego Agustín Moreno</name><uri>http://www.blogger.com/profile/16423070987153712849</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-LQ7aB6yKZ3E68XnjxSrKHMo0pXCtNPZ_7VwvrbhW75Sf7RGVLneoBz-gf5BicW_xYxwcOV4wpHWHleH17UiojkOc20ONOqGr5pcf5o8wvXxHvoBQp69WkWNDotkRw/s113/damv.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6872164117673495836.post-1896184804877628530</id><published>2012-06-16T00:55:00.002-05:00</published><updated>2013-07-11T16:33:44.186-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="beans"/><category scheme="http://www.blogger.com/atom/ns#" term="computación"/><category scheme="http://www.blogger.com/atom/ns#" term="código"/><category scheme="http://www.blogger.com/atom/ns#" term="código fuente"/><category scheme="http://www.blogger.com/atom/ns#" term="código java"/><category scheme="http://www.blogger.com/atom/ns#" term="fuente"/><category scheme="http://www.blogger.com/atom/ns#" term="hanoi"/><category scheme="http://www.blogger.com/atom/ns#" term="informática"/><category scheme="http://www.blogger.com/atom/ns#" term="ingeniería"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="jcreator"/><category scheme="http://www.blogger.com/atom/ns#" term="net"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="sistemas"/><category scheme="http://www.blogger.com/atom/ns#" term="torres"/><category scheme="http://www.blogger.com/atom/ns#" term="torres de hanoi"/><title type='text'>Código Fuente Java: Torres de Hanoi</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
Este&amp;nbsp;código&amp;nbsp;fuente&amp;nbsp;
&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;,&amp;nbsp;es para recrear el famoso rompecabezas o juego del matematico &lt;a href=&quot;http://es.wikipedia.org/wiki/Fran%C3%A7ois_%C3%89duard_Anatole_Lucas&quot; target=&quot;_blank&quot;&gt;Édouard Lucas&lt;/a&gt;:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;a href=&quot;http://es.wikipedia.org/wiki/Torres_de_Han%C3%B3i&quot; target=&quot;_blank&quot;&gt;Las Torres de Hanoi&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Para los que no lo saben, se trata de un juego matematicose trata de un juego de ocho discos de radio creciente que se apilan insertándose en una de las tres estacas de un tablero. El objetivo del juego es crear la pila en otra de las estacas siguiendo dos reglas: Las piezas se trasladan de una en una y no se puede colocar una pieza mayor sobre una menor. El problema es muy conocido en la ciencia de la computación y aparece en muchos libros de texto como introducción a la teoría de algoritmos.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
El problema de las Torres de Hanói es curiosísimo porque su solución es muy rápida de calcular, pero el número de pasos para resolverlo creceexponencialmente conforme aumenta el número de discos. Existen algunas versiones del problema con un número diferente de varillas. Aunque se conocen algoritmos eficientes que resuelven el problema con 3 varillas de manera óptima, no se han encontrado aún sus contrapartidas para cualquier número (N igual o superior a 3) de ellas.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;EL programa en&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;&amp;nbsp;esta compilado en&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/NetBeans&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;NetBeans&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;, que si no lo tienes te recomiendo que los descargues&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://netbeans.org/downloads/index.html&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;aquí&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;. Esta&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Entorno_de_desarrollo_integrado&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;IDE&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;(en español&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;text-align: justify;&quot;&gt;Entorno de Desarrollo Integrado&lt;/i&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;o en&amp;nbsp;ingles&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19px; text-align: justify;&quot;&gt;integrated development environment&lt;/i&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;), te hace mas amigable la vista del&amp;nbsp;código&amp;nbsp;cuando programas, ademas de que te van indicando los errores casi inmediatamente, otra de sus ventajas es que facilita el desarrollo con&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Interfaz_gr%C3%A1fica_de_usuario&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;GUI&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;(Interfaz&amp;nbsp;Gráfica&amp;nbsp;de Usuario).&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;Aquí&lt;/span&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&amp;nbsp;el&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;código fuente&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;de la clase torres&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre class=&quot;brush:java&quot;&gt;class torres
{
        private static int movimientos=0;
        public static int mover(int n, char a,char b, char c)
        {
                if(n&amp;gt;0){
                        mover(n-1, a,c,b);
                        System.out.println(&quot;mover disco &quot;+a+&quot; a &quot;+c);
                        movimientos++;
                        mover(n-1,b,a,c);
   }
                return movimientos;
         }
}
&lt;/pre&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;Aquí&lt;/span&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&amp;nbsp;el&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;código fuente&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;de la clase Hanoi&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre class=&quot;brush:java&quot;&gt;public class Hanoi
{

    public static void main(String[]args)
    {
     java.util.Scanner leer = new java.util.Scanner(System.in)
     int movimientos;
     System.out.println(&quot;Numero de discos: &quot;);
     int n=leer.nextInt();
     movimientos = torres.mover(n, &#39;A&#39;, &#39;B&#39;, &#39;C&#39;);
     System.out.println(&quot;\nMovimientos efectuados: &quot;+movimientos);
    }  
   
}
&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://cosasparafuturosingenieros.blogspot.com/feeds/1896184804877628530/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/06/codigo-fuente-java-torres-de-hanoi.html#comment-form' title='3 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/1896184804877628530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/1896184804877628530'/><link rel='alternate' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/06/codigo-fuente-java-torres-de-hanoi.html' title='Código Fuente Java: Torres de Hanoi'/><author><name>Diego Agustín Moreno</name><uri>http://www.blogger.com/profile/16423070987153712849</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-LQ7aB6yKZ3E68XnjxSrKHMo0pXCtNPZ_7VwvrbhW75Sf7RGVLneoBz-gf5BicW_xYxwcOV4wpHWHleH17UiojkOc20ONOqGr5pcf5o8wvXxHvoBQp69WkWNDotkRw/s113/damv.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6872164117673495836.post-879028153457716245</id><published>2012-06-16T00:20:00.004-05:00</published><updated>2013-07-11T16:35:05.131-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="comparar"/><category scheme="http://www.blogger.com/atom/ns#" term="computación"/><category scheme="http://www.blogger.com/atom/ns#" term="código"/><category scheme="http://www.blogger.com/atom/ns#" term="fuente"/><category scheme="http://www.blogger.com/atom/ns#" term="informática"/><category scheme="http://www.blogger.com/atom/ns#" term="ingeniería"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="jcreator"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="par o primo identificar"/><category scheme="http://www.blogger.com/atom/ns#" term="sistemas"/><title type='text'>Código Fuente Java: Numero Par o Primo</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
Codigo fuente&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;que te permite ingresar un numero y te dirá si este es&amp;nbsp;Par&amp;nbsp;o Primo.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;EL programa en&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;&amp;nbsp;esta compilado en&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/NetBeans&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;NetBeans&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;, que si no lo tienes te recomiendo que los descargues&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://netbeans.org/downloads/index.html&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;aquí&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;. Esta&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Entorno_de_desarrollo_integrado&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;IDE&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;(en español&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;text-align: justify;&quot;&gt;Entorno de Desarrollo Integrado&lt;/i&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;o en&amp;nbsp;ingles&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19px; text-align: justify;&quot;&gt;integrated development environment&lt;/i&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;), te hace mas amigable la vista del&amp;nbsp;código&amp;nbsp;cuando programas, ademas de que te van indicando los errores casi inmediatamente, otra de sus ventajas es que facilita el desarrollo con&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Interfaz_gr%C3%A1fica_de_usuario&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;GUI&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;(Interfaz&amp;nbsp;Gráfica&amp;nbsp;de Usuario)&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
El&amp;nbsp;código&amp;nbsp;fuente&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;la verdad que es muy sencillo, pero no faltará a quien le sirva el&amp;nbsp;método&amp;nbsp;para emplearlo en un programa mas&amp;nbsp;grande,&amp;nbsp;donde tengas que disponer de un&amp;nbsp;método&amp;nbsp;propio para&amp;nbsp;evaluar&amp;nbsp;la condición de un numero (Par o Primo).&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Bueno el&amp;nbsp;Código&amp;nbsp;Fuente Java:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:java&quot;&gt;public class Numeroprimo{
 public static void main(String[] args){
  java.util.Scanner leer = new java.util.Scanner(System.in)
  int x=leer.nextInt();
  int y=0;
  for (int i=2; i&amp;amp;lt,;x; i++)
  {
   y= x%i;
   if(y==0){
    System.out.println(x+&quot;: Este Numero es Par&quot;);
    break;
    }
  }
  if(y!=0){
    System.out.println(x+&quot;: Este Numero es Primo&quot;);
   }
 }
}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://cosasparafuturosingenieros.blogspot.com/feeds/879028153457716245/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/06/codigo-fuente-java-numero-par-o-primo.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/879028153457716245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/879028153457716245'/><link rel='alternate' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/06/codigo-fuente-java-numero-par-o-primo.html' title='Código Fuente Java: Numero Par o Primo'/><author><name>Diego Agustín Moreno</name><uri>http://www.blogger.com/profile/16423070987153712849</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-LQ7aB6yKZ3E68XnjxSrKHMo0pXCtNPZ_7VwvrbhW75Sf7RGVLneoBz-gf5BicW_xYxwcOV4wpHWHleH17UiojkOc20ONOqGr5pcf5o8wvXxHvoBQp69WkWNDotkRw/s113/damv.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6872164117673495836.post-4635649290749196145</id><published>2012-06-15T23:51:00.000-05:00</published><updated>2013-07-11T16:37:56.150-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="beans"/><category scheme="http://www.blogger.com/atom/ns#" term="computación"/><category scheme="http://www.blogger.com/atom/ns#" term="código"/><category scheme="http://www.blogger.com/atom/ns#" term="código fuente"/><category scheme="http://www.blogger.com/atom/ns#" term="código java"/><category scheme="http://www.blogger.com/atom/ns#" term="factorial"/><category scheme="http://www.blogger.com/atom/ns#" term="fuente"/><category scheme="http://www.blogger.com/atom/ns#" term="informática"/><category scheme="http://www.blogger.com/atom/ns#" term="ingeniería"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="net"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="sistemas"/><title type='text'>Código Fuente Java: Factorial</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
Otro&amp;nbsp;sencillo&amp;nbsp;programa en Java, que seguramente será una tarea para los que estudia algo relacionado con Java. Este Programa en Java lo que hace es que le ingresas un valor y te calcula el factorial de este.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
EL programa en&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;&amp;nbsp;esta compilado en&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/NetBeans&quot; target=&quot;_blank&quot;&gt;NetBeans&lt;/a&gt;, que si no lo tienes te recomiendo que los descargues&amp;nbsp;&lt;a href=&quot;http://netbeans.org/downloads/index.html&quot; target=&quot;_blank&quot;&gt;aquí&lt;/a&gt;. Esta&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Entorno_de_desarrollo_integrado&quot; target=&quot;_blank&quot;&gt;IDE&lt;/a&gt;&amp;nbsp;(en español&amp;nbsp;&lt;i&gt;Entorno de Desarrollo Integrado&lt;/i&gt;&amp;nbsp;o en&amp;nbsp;ingles&amp;nbsp;&lt;i style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;integrated development environment&lt;/i&gt;&amp;nbsp;), te hace mas amigable la vista del&amp;nbsp;código&amp;nbsp;cuando programas, ademas de que te van indicando los errores casi inmediatamente, otra de sus ventajas es que facilita el desarrollo con&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Interfaz_gr%C3%A1fica_de_usuario&quot; target=&quot;_blank&quot;&gt;GUI&lt;/a&gt;&amp;nbsp;(Interfaz&amp;nbsp;Gráfica&amp;nbsp;de Usuario)
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Aquí&amp;nbsp;el codigo&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;de la clase Ma:in:&lt;/b&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:java&quot;&gt;public class factotial {
     static long factorial(int v) {
            if (v&amp;gt;1)
                   return(v*factorial(v-1));
            return(1);
     }
     public static void main(String[] args) {
       java.util.Scanner leer = new java.util.Scanner(System.in)
       int k=leer.nextInt();
          System.out.println(factorial(k));
     }
} 
&lt;/pre&gt;
&lt;br /&gt;
Es importante resaltar que&amp;nbsp;cuando&amp;nbsp;programamos&amp;nbsp;en&amp;nbsp;
&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;el nombre del archivo&amp;nbsp;código&amp;nbsp;fuente&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;(nombredelarchivo.java)&amp;nbsp;deberá&amp;nbsp;coincidir&amp;nbsp;con el nombre de la clase de ese archivo.
</content><link rel='replies' type='application/atom+xml' href='http://cosasparafuturosingenieros.blogspot.com/feeds/4635649290749196145/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/06/codigo-fuente-java-factorial.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/4635649290749196145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/4635649290749196145'/><link rel='alternate' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/06/codigo-fuente-java-factorial.html' title='Código Fuente Java: Factorial'/><author><name>Diego Agustín Moreno</name><uri>http://www.blogger.com/profile/16423070987153712849</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-LQ7aB6yKZ3E68XnjxSrKHMo0pXCtNPZ_7VwvrbhW75Sf7RGVLneoBz-gf5BicW_xYxwcOV4wpHWHleH17UiojkOc20ONOqGr5pcf5o8wvXxHvoBQp69WkWNDotkRw/s113/damv.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6872164117673495836.post-4733794928540325277</id><published>2012-06-15T23:11:00.002-05:00</published><updated>2013-07-11T16:37:33.522-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="codigo fuente"/><category scheme="http://www.blogger.com/atom/ns#" term="codigo java"/><category scheme="http://www.blogger.com/atom/ns#" term="comparar"/><category scheme="http://www.blogger.com/atom/ns#" term="comprobar"/><category scheme="http://www.blogger.com/atom/ns#" term="computación"/><category scheme="http://www.blogger.com/atom/ns#" term="consonante"/><category scheme="http://www.blogger.com/atom/ns#" term="código"/><category scheme="http://www.blogger.com/atom/ns#" term="fuente"/><category scheme="http://www.blogger.com/atom/ns#" term="informática"/><category scheme="http://www.blogger.com/atom/ns#" term="ingeniería"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="jcreator"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="sistemas"/><category scheme="http://www.blogger.com/atom/ns#" term="vocal"/><title type='text'>Código Fuente Java: Programa Es Vocal o Consonante</title><content type='html'>Este es un Pequeño Programa en&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;, que si estas en una materia de&amp;nbsp;Programación&amp;nbsp;Orientada a Objetos, de seguro te lo van a pedir de tarea.&lt;br /&gt;
&lt;br /&gt;
EL programa en&amp;nbsp;
&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;&amp;nbsp;esta compilado en &lt;a href=&quot;http://es.wikipedia.org/wiki/NetBeans&quot; target=&quot;_blank&quot;&gt;NetBeans&lt;/a&gt;, que si no lo tienes te recomiendo que los descargues &lt;a href=&quot;http://netbeans.org/downloads/index.html&quot; target=&quot;_blank&quot;&gt;aquí&lt;/a&gt;. Esta&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Entorno_de_desarrollo_integrado&quot; target=&quot;_blank&quot;&gt;IDE&lt;/a&gt;&amp;nbsp;(en español &lt;i&gt;Entorno de Desarrollo Integrado&lt;/i&gt; o en&amp;nbsp;ingles&amp;nbsp;&lt;i style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;integrated development environment&lt;/i&gt;&amp;nbsp;), te hace mas amigable la vista del&amp;nbsp;código&amp;nbsp;cuando programas, ademas de que te van indicando los errores casi inmediatamente, otra de sus ventajas es que facilita el desarrollo con &lt;a href=&quot;http://es.wikipedia.org/wiki/Interfaz_gr%C3%A1fica_de_usuario&quot; target=&quot;_blank&quot;&gt;GUI&lt;/a&gt; (Interfaz&amp;nbsp;Gráfica&amp;nbsp;de Usuario).&lt;br /&gt;
&lt;br /&gt;
En caso de que no quieras instalar &lt;a href=&quot;http://es.wikipedia.org/wiki/NetBeans&quot; target=&quot;_blank&quot;&gt;NetBeans&lt;/a&gt;&amp;nbsp;entonces pues puedes&amp;nbsp;compilarlo&amp;nbsp;con &lt;a href=&quot;http://es.wikipedia.org/wiki/JCreator&quot; target=&quot;_blank&quot;&gt;JCreator&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Bueno sin mas&amp;nbsp;preámbulo&amp;nbsp;el programa. Este Programa en&amp;nbsp;
&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;&amp;nbsp;lo que haces es que le ingresas un valor &lt;b&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Tipo_de_dato_car%C3%A1cter&quot; target=&quot;_blank&quot;&gt;char&lt;/a&gt;&lt;/b&gt;&amp;nbsp;y el programa en java te dice si es vocal o consonante.&lt;br /&gt;
&lt;br /&gt;
El&amp;nbsp;Código&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Java_(lenguaje_de_programaci%C3%B3n)&quot; target=&quot;_blank&quot;&gt;Java&lt;/a&gt;&amp;nbsp;&amp;nbsp;del Programa:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;public class bocalono {
      public static void main(String[] args) {
    java.util.Scanner leer = new java.util.Scanner(System.in)
    char a=leer.nextChar();
    switch(a){
        case &#39;a&#39;:
            System.out.println(a+&quot; es vocal&quot;);
            break;
        case &#39;e&#39;:
            System.out.println(a+&quot; es vocal&quot;);
            break;
        case &#39;i&#39;:
            System.out.println(a+&quot; es vocal&quot;);
            break;
        case &#39;o&#39;:
            System.out.println(a+&quot; es vocal&quot;);
            break;
        case &#39;u&#39;:
            System.out.println(a+&quot; es vocal&quot;);
            break;
        default:
            System.out.println(a+&quot; es consonante&quot;);
    }
  }
}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://cosasparafuturosingenieros.blogspot.com/feeds/4733794928540325277/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/06/codigo-fuente-java-programa-es-bocal-o.html#comment-form' title='2 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/4733794928540325277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/4733794928540325277'/><link rel='alternate' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/06/codigo-fuente-java-programa-es-bocal-o.html' title='Código Fuente Java: Programa Es Vocal o Consonante'/><author><name>Diego Agustín Moreno</name><uri>http://www.blogger.com/profile/16423070987153712849</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-LQ7aB6yKZ3E68XnjxSrKHMo0pXCtNPZ_7VwvrbhW75Sf7RGVLneoBz-gf5BicW_xYxwcOV4wpHWHleH17UiojkOc20ONOqGr5pcf5o8wvXxHvoBQp69WkWNDotkRw/s113/damv.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6872164117673495836.post-2445663694838926057</id><published>2012-03-13T08:51:00.003-06:00</published><updated>2012-03-13T09:01:12.170-06:00</updated><title type='text'>App Creada por Egresado ESIME Culhuacan</title><content type='html'>&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Un egresado de la &amp;nbsp;&lt;a href=&quot;http://www.esimecu.ipn.mx/&quot;&gt;Escuela Superior de Ingeniería Mecánica y Eléctrica Unidad Culhucan&lt;/a&gt;&amp;nbsp;se dio a la tarea de facilitar la vida de aquellas personas que gustan de los placeres carnales&amp;nbsp;(sexo) a cualquier hora del&amp;nbsp;día, su nombre Mario Alba.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://a1.mzstatic.com/us/r1000/065/Purple/2a/1b/f6/mzl.repmegqm.320x480-75.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://a1.mzstatic.com/us/r1000/065/Purple/2a/1b/f6/mzl.repmegqm.320x480-75.jpg&quot; width=&quot;213&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Hoteles Paco Heart es tu guia de hoteles y moteles para tu iPhone y iPod.&lt;br /&gt;&lt;br /&gt;Cuantas veces te ha pasado que no sabes a que hotel ir con tu pareja. No sabes si tiene jacuzzi. O cuanto te puede costar.&lt;br /&gt;&lt;br /&gt;Tienes que estar preguntando con tus amigos recomendaciones.&lt;br /&gt;&lt;br /&gt;Y Lo mas importante no sabes como llegar a ese motel. Con Hoteles Paco Heart eso ha terminado:&lt;br /&gt;&lt;br /&gt;Guia de Hoteles y Moteles de Paso del Distrito Federal y Area&amp;nbsp;Metropolitana&amp;nbsp;(DF y Estado de México).&lt;br /&gt;&lt;br /&gt;Si quieres tener una noche de pasión nosotros te decimos donde.&lt;br /&gt;&lt;br /&gt;- Te damos los 5 hoteles y Moteles mas cercanos a tu posicion.&lt;br /&gt;&lt;br /&gt;- Google maps y streetviews de cada hotel para que puedas trazar la ruta y nunca perderte.&lt;br /&gt;&lt;br /&gt;- Rankings por hotel, puedes votar el hotel favorito y ver las calificaiones de otros usuarios para saber si la velada sera fabulosa en ese lugar.&lt;br /&gt;&lt;br /&gt;- Precios por habitación: Te damos los precios de cada habitacion que ofrece el hotel.&lt;br /&gt;&lt;br /&gt;- Restaurante y otros servicios: Te decimos si el hotel al que planeas ir tiene servicio de&amp;nbsp;restaurante. Cochera para guardar tu auto (villas), y muchos servicios mas.&lt;br /&gt;&lt;br /&gt;- Telefonos del hotel: Las cosas cambian muy rapido hoy en dia, si tienes dudas de alguna habitación, o quieres saber la promoción del dia, te facilitamos el telefono directo de cada hotel en la ciudad de mexico.&lt;br /&gt;&lt;br /&gt;- Favoritos: Puedes guardar en tus favoritos los hoteles que mas te gusta.&lt;br /&gt;&lt;br /&gt;- No necesitas conexion de internet para la mayoria de funciones, asi que funcionará perfecto en tu ipod.&lt;br /&gt;&lt;br /&gt;Con esta&amp;nbsp;guía&amp;nbsp;de Hoteles y Moteles, Siempre sabrás a cual ir, en cualquier momento y en&amp;nbsp;cuestión&amp;nbsp;de segundos..&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Sin mas que agregar&amp;nbsp;aquí&amp;nbsp;el enlace:&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;a href=&quot;http://itunes.apple.com/us/app/hoteles-paco-heart/id455446846?l=es&amp;amp;ls=1&amp;amp;mt=8&quot;&gt;Hoteles Paco Heart&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/&quot;&gt;&lt;/a&gt;&lt;span id=&quot;goog_1240367281&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1240367282&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cosasparafuturosingenieros.blogspot.com/feeds/2445663694838926057/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/03/app-creada-por-egresado-esime-culhuacan.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/2445663694838926057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/2445663694838926057'/><link rel='alternate' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/03/app-creada-por-egresado-esime-culhuacan.html' title='App Creada por Egresado ESIME Culhuacan'/><author><name>Diego Agustín Moreno</name><uri>http://www.blogger.com/profile/16423070987153712849</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-LQ7aB6yKZ3E68XnjxSrKHMo0pXCtNPZ_7VwvrbhW75Sf7RGVLneoBz-gf5BicW_xYxwcOV4wpHWHleH17UiojkOc20ONOqGr5pcf5o8wvXxHvoBQp69WkWNDotkRw/s113/damv.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6872164117673495836.post-7078338475372354554</id><published>2012-03-07T09:55:00.001-06:00</published><updated>2012-10-13T18:46:09.309-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="blog de códigos"/><category scheme="http://www.blogger.com/atom/ns#" term="computación"/><category scheme="http://www.blogger.com/atom/ns#" term="fuente"/><category scheme="http://www.blogger.com/atom/ns#" term="informática"/><category scheme="http://www.blogger.com/atom/ns#" term="ingeniería"/><category scheme="http://www.blogger.com/atom/ns#" term="sistemas"/><title type='text'>Objetivo de este Blog</title><content type='html'>Este Blog se creó con el fin de proporcionar a Estudiantes de&amp;nbsp;Ingeniería&amp;nbsp;algunas herramientas que posiblemente serán de&amp;nbsp;gran&amp;nbsp;utilidad.&lt;br /&gt;
&lt;br /&gt;
La principal&amp;nbsp;especialidad de&amp;nbsp;ingeniería&amp;nbsp;a la que va dirigida es la de&amp;nbsp;Computación, sin embargo, al ser una&amp;nbsp;ingeniería&amp;nbsp;implica las ciencias fundamentales de una ingeniería:&amp;nbsp;Física,&amp;nbsp;Química,&amp;nbsp;Matemáticas. Entonces si una carrera que se dice llamar a si misma&amp;nbsp;ingeniería&amp;nbsp;no tiene estas tres ciencias significa que es cualquier otra cosa menos&amp;nbsp;ingeniería.&lt;br /&gt;
&lt;br /&gt;
Espero les sea de Utilidad.</content><link rel='replies' type='application/atom+xml' href='http://cosasparafuturosingenieros.blogspot.com/feeds/7078338475372354554/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/03/objetivo-de-este-blog.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/7078338475372354554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6872164117673495836/posts/default/7078338475372354554'/><link rel='alternate' type='text/html' href='http://cosasparafuturosingenieros.blogspot.com/2012/03/objetivo-de-este-blog.html' title='Objetivo de este Blog'/><author><name>Diego Agustín Moreno</name><uri>http://www.blogger.com/profile/16423070987153712849</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-LQ7aB6yKZ3E68XnjxSrKHMo0pXCtNPZ_7VwvrbhW75Sf7RGVLneoBz-gf5BicW_xYxwcOV4wpHWHleH17UiojkOc20ONOqGr5pcf5o8wvXxHvoBQp69WkWNDotkRw/s113/damv.png'/></author><thr:total>0</thr:total></entry></feed>