<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
>
	<channel>
		<title>Dudas de Programacion &#187; Tag: listas dobles - Recent Posts</title>
		<link>http://www.dudasprogramacion.com/tags/listas-dobles</link>
		<description>Dudas sobre lenguajes y apis de programación</description>
		<language>en-US</language>
		<pubDate>Tue, 07 Feb 2012 22:39:35 +0000</pubDate>
		<generator>bbpress 1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.dudasprogramacion.com/search.php</link>
		</textInput>
		<atom:link href="http://www.dudasprogramacion.com/rss/tags/listas-dobles" rel="self" type="application/rss+xml" />

		<item>
			<title>Torres on "Dudas sobre listas simple y doblemente enlazadas en C"</title>
			<link>http://www.dudasprogramacion.com/topic/dudas-sobre-listas-simple-y-doblemente-enlazadas-en-c#post-202</link>
			<pubDate>Sun, 06 Sep 2009 12:40:27 +0000</pubDate>
			<dc:creator>Torres</dc:creator>
			<guid isPermaLink="false">202@http://www.dudasprogramacion.com/</guid>
			<description><p>La explicación es básicamente la que tienes arriba, con ejemplos incluidos. En cuanto a usar una u otra depende, aunque no hay mucha diferencia, la doblemente enlazada ocupa mas memoria pero también es mas rápida al obtener por ejemplo al nodo anterior al nodo dado.</p>
<p><a href="http://es.wikipedia.org/wiki/Lista_%28inform%C3%A1tica%29#Listas_simples_enlazadas" rel="nofollow">http://es.wikipedia.org/wiki/Lista_%28inform%C3%A1tica%29#Listas_simples_enlazadas</a>
</p></description>
		</item>
		<item>
			<title>loaj69 on "Dudas sobre listas simple y doblemente enlazadas en C"</title>
			<link>http://www.dudasprogramacion.com/topic/dudas-sobre-listas-simple-y-doblemente-enlazadas-en-c#post-190</link>
			<pubDate>Mon, 24 Aug 2009 00:27:22 +0000</pubDate>
			<dc:creator>loaj69</dc:creator>
			<guid isPermaLink="false">190@http://www.dudasprogramacion.com/</guid>
			<description><p><strong> LISTAS ENLAZADAS DOBLES </strong></p>
<p>Cada nodo tiene dos enlaces: uno apunta al nodo anterior, o apunta al valor NULL o a la lista vacía si es el primer nodo; y otro que apunta al siguiente nodo siguiente, o apunta al valor NULL o a la lista vacía si es el último nodo.</p>
<p>X &#60;---. 12 .&#60;======&#62; .</p>
<p>Ejemplo:<br />
#include&#60;alloc.h&#62;<br />
#include&#60;stdlib.h&#62;<br />
#include&#60;conio.h&#62;<br />
#include&#60;iostream.h&#62;</p>
<p>//Estructuras Doblemente enlazadas<br />
typedef struct nododoble<br />
{<br />
int dato;<br />
struct nododoble *sig;<br />
struct nododoble *ant;</p>
<p>}tipoNodo;</p>
<p>//PROTOTIPOS<br />
tipoNodo *nuevo_elemento();<br />
void creardoble();<br />
void presentar();<br />
void insertar();<br />
void insertarfinaldoble();<br />
void insertarordenadodoble();<br />
void insertariniciodoble();<br />
void modificar();<br />
void buscar();<br />
void ordenar();<br />
void ordenardoblesasc();<br />
void ordenardoblesdesc();<br />
void eliminar();<br />
void eliminar_cabeza();<br />
void cuadro(int x1,int y1,int x2,int y2,char c);</p>
<p>tipoNodo *cab;<br />
tipoNodo *cola;</p>
<p>tipoNodo *nuevo_elemento()<br />
{<br />
tipoNodo  *nodo1;<br />
nodo1=(tipoNodo *)malloc(sizeof(tipoNodo ));<br />
if(!nodo1)<br />
cout&#60;&#60;”No se ha reservado memoria para el nuevo “;<br />
return nodo1;<br />
}</p>
<p>//MENU PRINCIPAL<br />
void  main()<br />
{<br />
clrscr();<br />
creardoble();<br />
clrscr();<br />
char opc=’ ‘;</p>
<p>do<br />
{</p>
<p>clrscr();<br />
cuadro(1,10,35,56,’’);<br />
gotoxy(13,3);cout&#60;&#60;”-&#62;[ LISTAS ENLAZADAS DOBLES ]&#60;-\n”;<br />
gotoxy(12,6);cout&#60;&#60;”    MENU PRINCIPAL\n”;<br />
gotoxy(12,9); cout&#60;&#60;” [1]:  INSERTAR \n”;<br />
gotoxy(12,12);cout&#60;&#60;” [2]:  MODIFICAR\n”;<br />
gotoxy(12,15);cout&#60;&#60;” [3]:  BUSCAR\n”;<br />
gotoxy(12,17);cout&#60;&#60;” [4]:  ORDENAR\n”;<br />
gotoxy(12,19);cout&#60;&#60;” [5]:  ELIMINAR\n”;<br />
gotoxy(12,21);cout&#60;&#60;” [6]:  PRESENTAR\n”;<br />
gotoxy(12,24);cout&#60;&#60;” [7]:  SALIR DEL MENU\n”;<br />
gotoxy(12,27);cout&#60;&#60;” Elegir una Opci¢n [ ]“;<br />
gotoxy(32,27);cin&#62;&#62;opc;</p>
<p>switch(opc)<br />
{<br />
case’1′:<br />
clrscr();<br />
insertar();;getch();break;<br />
case’2′:<br />
clrscr();<br />
modificar();getch();break;<br />
case’3′:<br />
clrscr();<br />
buscar();getch();break;<br />
case’4′:<br />
clrscr();<br />
ordenar();getch();break;<br />
case’5′:<br />
clrscr();<br />
eliminar();getch();break;</p>
<p>case’6′:<br />
clrscr();<br />
presentar();getch();break;</p>
<p>}</p>
<p>}while(opc!=’7′);</p>
<p>getch();</p>
<p>}</p>
<p>//CREAR LA CABEZA<br />
void creardoble()<br />
{<br />
clrscr();<br />
int dat;<br />
gotoxy(20,20);<br />
cout&#60;&#60;”Ingrese Elemento:  “;<br />
cin&#62;&#62;dat;<br />
cab=nuevo_elemento();<br />
cola=nuevo_elemento();<br />
cab-&#62;dato=dat;<br />
cab-&#62;sig=NULL;<br />
cab-&#62;ant=NULL;<br />
cola=cab;<br />
getch();<br />
}</p>
<p>void insertar()<br />
{<br />
clrscr();<br />
char opc=’ ‘;</p>
<p>do<br />
{</p>
<p>clrscr();<br />
cuadro(1,10,25,56,’’);<br />
gotoxy(13,3);cout&#60;&#60;”-&#62;[ INSERTAR ELEMENMTOS A LA LISTA ENLAZADA ]&#60;-\n”;<br />
gotoxy(12,6); cout&#60;&#60;” [1]:  INSERTAR ORDENADO\n”;<br />
gotoxy(12,9);cout&#60;&#60;” [2]:  INSERTAR CABEZA\n”;<br />
gotoxy(12,12);cout&#60;&#60;” [3]:  INSERTAR AL FINAL\n”;<br />
gotoxy(12,15);cout&#60;&#60;” [4]:  REGRESAR\n”;<br />
gotoxy(12,17);cout&#60;&#60;” Elegir una Opci¢n [ ]“;<br />
gotoxy(32,17);cin&#62;&#62;opc;<br />
switch(opc)<br />
{<br />
case’1′:<br />
clrscr();<br />
insertarordenadodoble();getch();break;</p>
<p>case’2′:<br />
clrscr();</p>
<p>insertariniciodoble();getch();break;</p>
<p>case’3′:<br />
clrscr();<br />
insertarfinaldoble();getch();break;<br />
}</p>
<p>}<br />
while(opc!=’4′);</p>
<p>getch();</p>
<p>}</p>
<p>void insertarfinaldoble()<br />
{<br />
clrscr();<br />
nododoble *elem;<br />
elem=nuevo_elemento();<br />
clrscr();<br />
gotoxy(20,20);<br />
cout&#60;&#60;”\t\t”&#60;&#60;”INGRESE VALOR  :\t”;<br />
cin&#62;&#62;elem-&#62;dato;<br />
cola-&#62;sig=elem;<br />
elem-&#62;sig=NULL;<br />
elem-&#62;ant=cola;<br />
cola=elem;<br />
getch();<br />
}</p>
<p>void insertarordenadodoble()<br />
{<br />
int dat;<br />
nododoble *aux;<br />
nododoble *ant;<br />
nododoble *post;<br />
aux=nuevo_elemento();<br />
ant=nuevo_elemento();<br />
post=nuevo_elemento();<br />
gotoxy(18,22);<br />
cout&#60;&#60;”Ingrese un elemento: “;<br />
cin&#62;&#62;dat;<br />
aux-&#62;dato=dat;<br />
if(aux-&#62;dato&#62;cab-&#62;dato)<br />
{</p>
<p>ant=cab;<br />
post=cab-&#62;sig;</p>
<p>while((aux-&#62;dato&#62;post-&#62;dato) &#38;&#38; (post-&#62;sig!=NULL))<br />
{<br />
ant=post;<br />
post=post-&#62;sig;<br />
}<br />
if (post-&#62;sig==NULL)<br />
{</p>
<p>if (aux-&#62;dato&#60;post-&#62;dato){<br />
aux-&#62;sig=post;<br />
post-&#62;ant=aux;<br />
ant-&#62;sig=aux;<br />
aux-&#62;ant=ant;<br />
}else{<br />
aux-&#62;sig=NULL;<br />
post-&#62;sig=aux;<br />
aux-&#62;ant=post;<br />
}<br />
}<br />
else<br />
{<br />
aux-&#62;sig=post;<br />
post-&#62;ant=aux;<br />
ant-&#62;sig=aux;<br />
aux-&#62;ant=ant;<br />
}<br />
}<br />
else{<br />
aux-&#62;dato=dat;<br />
aux-&#62;sig=cab;<br />
cab-&#62;ant=aux;<br />
aux-&#62;ant=NULL;<br />
cab=aux;<br />
}<br />
}<br />
void insertariniciodoble()<br />
{<br />
nododoble *Aux;<br />
int dat;<br />
Aux=nuevo_elemento();<br />
gotoxy(18,22);<br />
cout&#60;&#60;”Ingrese un numero:”;<br />
cin&#62;&#62;dat;<br />
Aux-&#62;dato=dat;<br />
Aux-&#62;ant=NULL;<br />
Aux-&#62;sig=cab;<br />
cab-&#62;ant=Aux;<br />
cab=Aux;<br />
}</p>
<p>void modificar()<br />
{<br />
clrscr();<br />
nododoble *modificar;<br />
nododoble *ele;<br />
modificar=nuevo_elemento();<br />
int db,encontrado=0;<br />
modificar=cab;<br />
gotoxy(10,20);<br />
cout&#60;&#60;”\t”&#60;&#60;”INGRESE EL VALOR A MODIFICAR :\t”;<br />
cin&#62;&#62; db;<br />
while(modificar!=NULL)<br />
{<br />
if(db==modificar-&#62;dato)<br />
{<br />
gotoxy(10,22);cout&#60;&#60;”Elemento existente en la lista”;<br />
encontrado=1;<br />
gotoxy(10,25);<br />
cout&#60;&#60;”\t\t”&#60;&#60;”INGRESE VALOR  :\t”;<br />
cin&#62;&#62;ele-&#62;dato;<br />
modificar-&#62;dato=ele-&#62;dato;</p>
<p>}<br />
modificar=modificar-&#62;sig;</p>
<p>}<br />
if(encontrado==0)<br />
{<br />
gotoxy(10,22);cout&#60;&#60;”Elemento no existente en la lista”;<br />
}</p>
<p>getch();<br />
}<br />
void buscar()<br />
{<br />
clrscr();<br />
nododoble *buscar;<br />
buscar=nuevo_elemento();<br />
int db,encontrado=0;<br />
buscar=cab;<br />
gotoxy(18,15);<br />
cout&#60;&#60;”Ingrese el numero a buscar: “;<br />
cin&#62;&#62; db;<br />
while(buscar!=NULL)<br />
{<br />
if(db==buscar-&#62;dato)<br />
{<br />
gotoxy(18,18);cout&#60;&#60;”Elemento existente en la lista”;<br />
encontrado=1;<br />
}<br />
buscar=buscar-&#62;sig;<br />
}<br />
if(encontrado==0)<br />
{<br />
gotoxy(18,18);cout&#60;&#60;”Elemento no existente en la lista”;<br />
}<br />
getch();<br />
}</p>
<p>void ordenar()<br />
{<br />
clrscr();<br />
char opc=’ ‘;</p>
<p>do<br />
{</p>
<p>clrscr();<br />
cuadro(1,10,25,56,’’);<br />
gotoxy(13,3);cout&#60;&#60;”-&#62;[ ORDENAR  LAS LISTAS ENLAZADAS ]&#60;-\n”;<br />
gotoxy(12,6);cout&#60;&#60;”    MENU PRINCIPAL\n”;<br />
gotoxy(12,9); cout&#60;&#60;” [1]:  ORDENAR ASCENDENTE\n”;<br />
gotoxy(12,12);cout&#60;&#60;” [2]:  ORDENAR DESCENDENTE\n”;<br />
gotoxy(12,15);cout&#60;&#60;” [3]:  REGRESAR\n”;</p>
<p>gotoxy(12,17);cout&#60;&#60;” Elegir una Opci¢n [ ]“;<br />
gotoxy(32,17);cin&#62;&#62;opc;<br />
switch(opc)<br />
{<br />
case’1′:<br />
clrscr();<br />
ordenardoblesasc();break;<br />
case’2′:<br />
clrscr();<br />
ordenardoblesdesc();break;</p>
<p>}</p>
<p>}<br />
while(opc!=’3′);</p>
<p>getch();</p>
<p>}<br />
void ordenardoblesasc()<br />
{<br />
nododoble *aux;<br />
nododoble *temp;<br />
int vaux;<br />
aux=nuevo_elemento();<br />
temp=nuevo_elemento();<br />
aux=cab;<br />
while (aux!=NULL)<br />
{<br />
temp=aux;<br />
while(temp-&#62;sig!=NULL)<br />
{<br />
temp=temp-&#62;sig;<br />
if(aux-&#62;dato&#62;temp-&#62;dato)<br />
{<br />
vaux=aux-&#62;dato;<br />
aux-&#62;dato=temp-&#62;dato;<br />
temp-&#62;dato=vaux;<br />
}<br />
}<br />
aux=aux-&#62;sig;<br />
}<br />
}<br />
void ordenardoblesdesc()<br />
{<br />
nododoble *aux;<br />
nododoble *temp;<br />
int vaux;<br />
aux=nuevo_elemento();<br />
temp=nuevo_elemento();<br />
aux=cab;<br />
while (aux!=NULL)<br />
{<br />
temp=aux;<br />
while(temp-&#62;sig!=NULL)<br />
{<br />
temp=temp-&#62;sig;<br />
if(aux-&#62;dato&#60;temp-&#62;dato)<br />
{<br />
vaux=aux-&#62;dato;<br />
aux-&#62;dato=temp-&#62;dato;<br />
temp-&#62;dato=vaux;<br />
}<br />
}<br />
aux=aux-&#62;sig;<br />
}<br />
}</p>
<p>void presentar()<br />
{<br />
clrscr();</p>
<p>int c=8;<br />
nododoble  *recorre;<br />
recorre=nuevo_elemento();<br />
recorre=cab;<br />
gotoxy(18,7);<br />
cout&#60;&#60;”   ELEMENTOS INSERTADOS: \n”;<br />
while(recorre!=NULL)<br />
{<br />
c=c+1;<br />
gotoxy(30,c);cout&#60;&#60;recorre-&#62;dato&#60;&#60;”\n”;<br />
recorre=recorre-&#62;sig;<br />
}<br />
getch();<br />
}</p>
<p>void eliminar()<br />
{<br />
presentar();<br />
nododoble *eliminar;<br />
nododoble *asigna;<br />
gotoxy(10,25);cout&#60;&#60;”ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n”;<br />
gotoxy(10,26);cout&#60;&#60;”º                          º\n”;<br />
gotoxy(10,27);cout&#60;&#60;”ºINSERTAR NUMERO A ELIMINARº\n”;<br />
gotoxy(10,28);cout&#60;&#60;”º                          º\n”;<br />
gotoxy(10,29);cout&#60;&#60;”ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼\n”;<br />
gotoxy(10,31);cout&#60;&#60;”Ingrese el n—mero a eliminar\t”;<br />
cin&#62;&#62;eliminar-&#62;dato;<br />
if (eliminar-&#62;dato==cab-&#62;dato)<br />
{</p>
<p>eliminar_cabeza();<br />
}</p>
<p>else<br />
{<br />
nododoble *anterior=cab;<br />
nododoble * aux=cab-&#62;sig;</p>
<p>while((aux!=NULL)&#38;&#38;(aux-&#62;dato!=eliminar-&#62;dato))<br />
{<br />
anterior=aux;<br />
aux=aux-&#62;sig;<br />
}<br />
if(aux!=NULL)<br />
{<br />
asigna=aux-&#62;sig;<br />
anterior-&#62;sig=asigna;<br />
aux-&#62;ant=anterior;<br />
aux-&#62;ant=NULL;<br />
aux-&#62;sig=NULL;<br />
free(aux);<br />
}<br />
else<br />
{<br />
gotoxy(10,33);<br />
cout&#60;&#60;”NO SE ENCUENTRA”;<br />
}<br />
}</p>
<p>}</p>
<p>void eliminar_cabeza()<br />
{<br />
nododoble *aux;<br />
aux=cab;<br />
cab=cab-&#62;sig;<br />
aux-&#62;sig=NULL;<br />
aux-&#62;ant=NULL;<br />
free(aux);<br />
}</p>
<p>void cuadro(int x1,int y1, int x2, int y2, char simb)<br />
{<br />
for (int i1=y1;i1&#60;=y2;i1++)<br />
{<br />
gotoxy(i1,x1);cout&#60;&#60;simb;<br />
gotoxy(i1,x2);cout&#60;&#60;simb;<br />
}<br />
for (int i2=x1;i2&#60;=x2;i2++)<br />
{<br />
gotoxy(y1,i2);cout&#60;&#60;simb;<br />
gotoxy(y2,i2);cout&#60;&#60;simb;<br />
}<br />
}
</p></description>
		</item>
		<item>
			<title>loaj69 on "Dudas sobre listas simple y doblemente enlazadas en C"</title>
			<link>http://www.dudasprogramacion.com/topic/dudas-sobre-listas-simple-y-doblemente-enlazadas-en-c#post-189</link>
			<pubDate>Mon, 24 Aug 2009 00:23:51 +0000</pubDate>
			<dc:creator>loaj69</dc:creator>
			<guid isPermaLink="false">189@http://www.dudasprogramacion.com/</guid>
			<description><p>mira Chicalight_ primero Una lista es un conjunto de elementos llamados nodos en los que cada uno de ellos contiene un dato y tambien la direccion del siguiente nodo, donde el orden de los mismos se establece mediante punteros.</p>
<p>LISTA ENLAZADA SIMPLE<br />
La lista enlazada básica es la lista enlazada simple la cual tiene un enlace por nodo. Este enlace apunta al siguiente nodo en la lista, o al valor NULL o a la lista vacía, si es el último nodo.</p>
<p>12.---&#62;99.---&#62;37</p>
<p>He aquì te dejo un ejemplo de una lista enlazada simple, ojala que te sirva como referencia:<br />
#include&#60;alloc.h&#62;<br />
#include&#60;stdlib.h&#62;<br />
#include&#60;conio.h&#62;<br />
#include&#60;iostream.h&#62;<br />
//Declaramosla estructura<br />
typedef struct nodo<br />
{<br />
int dato;<br />
struct nodo * siguiente;<br />
}tipoNodo;<br />
//reservamos el espacio de memoria<br />
tipoNodo *nuevo_elemento();</p>
<p>//Operaciones que vamos a arealizar<br />
void crear();<br />
void insertar();<br />
void insertar_inicio();<br />
void insertar_ordenado();<br />
void insertar_final();<br />
void presentar();<br />
void modificar();<br />
void buscar();<br />
void ordenar();<br />
void ordenar_ascendente();<br />
void ordenar_descendente();<br />
void eliminar();<br />
void eliminar_cabeza();</p>
<p>//FUNCION PARA EL CUADRO<br />
void cuadro(int x1,int y1, int x2, int y2, char simb);</p>
<p>//NUESTRA CABEZA<br />
tipoNodo *cab;</p>
<p>tipoNodo *nuevo_elemento()<br />
{<br />
tipoNodo *nodo1;<br />
nodo1=(tipoNodo *)malloc(sizeof(tipoNodo ));<br />
if(!nodo1)<br />
cout&#60;&#60;”No se ha reservado memoria para el nuevo “;<br />
return nodo1;<br />
}</p>
<p>void  main()<br />
{<br />
clrscr();<br />
crear();<br />
clrscr();<br />
char opc=’ ‘;</p>
<p>do<br />
{</p>
<p>clrscr();<br />
cuadro(1,10,35,56,’²’);<br />
gotoxy(13,3);cout&#60;&#60;”-&#62;[ LISTAS ENLAZADAS ]&#60;-\n”;<br />
gotoxy(12,6);cout&#60;&#60;”    MENU PRINCIPAL\n”;<br />
gotoxy(12,9); cout&#60;&#60;” [1]:  INSERTAR\n”;<br />
gotoxy(12,12);cout&#60;&#60;” [2]:  MODIFICAR\n”;<br />
gotoxy(12,15);cout&#60;&#60;” [3]:  BUSCAR\n”;<br />
gotoxy(12,17);cout&#60;&#60;” [4]:  ORDENAR\n”;<br />
gotoxy(12,19);cout&#60;&#60;” [5]:  ELIMINAR\n”;<br />
gotoxy(12,21);cout&#60;&#60;” [6]:  PRESENTAR\n”;<br />
gotoxy(12,24);cout&#60;&#60;” [7]:  SALIR DEL MENU\n”;</p>
<p>gotoxy(12,27);cout&#60;&#60;” Elegir una Opci¢n [ ]“;<br />
gotoxy(32,27);cin&#62;&#62;opc;</p>
<p>switch(opc)<br />
{<br />
case’1′:<br />
clrscr();<br />
insertar();getch();break;<br />
case’2′:<br />
clrscr();<br />
modificar();getch();break;<br />
case’3′:<br />
clrscr();<br />
buscar();getch();break;<br />
case’4′:<br />
clrscr();<br />
ordenar();getch();break;<br />
case’5′:<br />
clrscr();<br />
eliminar();getch();break;</p>
<p>case’6′:<br />
clrscr();<br />
presentar();getch();break;</p>
<p>}</p>
<p>}while(opc!=’7′);</p>
<p>getch();</p>
<p>}<br />
//CREANDO LA CABEZA<br />
void crear()<br />
{<br />
clrscr();<br />
cab=nuevo_elemento();<br />
gotoxy(20,20);<br />
cout&#60;&#60;”Ingrese valor de cabeza :\t”;<br />
cin&#62;&#62;cab-&#62;dato;<br />
cab-&#62;siguiente=NULL;<br />
getch();<br />
}<br />
//MENU DE INSERTAR<br />
void insertar()<br />
{<br />
clrscr();<br />
char opc=’ ‘;</p>
<p>do<br />
{</p>
<p>clrscr();<br />
cuadro(1,10,35,56,’²’);<br />
gotoxy(13,3);cout&#60;&#60;”-&#62;[ LISTAS ENLAZADAS ]&#60;-\n”;<br />
gotoxy(12,6);cout&#60;&#60;”    MENU PRINCIPAL\n”;<br />
gotoxy(12,9); cout&#60;&#60;” [1]:  INSERTAR AL INICIO\n”;<br />
gotoxy(12,12);cout&#60;&#60;” [2]:  insertar AL FINAL\n”;<br />
gotoxy(12,15);cout&#60;&#60;” [3]:  INSERTAR ORDENADO\n”;<br />
gotoxy(12,18);cout&#60;&#60;” [4]:  REGRESAR\n”;</p>
<p>gotoxy(12,21);cout&#60;&#60;” Elegir una Opci¢n [ ]“;<br />
gotoxy(32,21);cin&#62;&#62;opc;</p>
<p>switch(opc)<br />
{<br />
case’1′:<br />
clrscr();<br />
insertar_inicio();getch();break;<br />
case’2′:<br />
clrscr();<br />
insertar_final();getch();break;<br />
case’3′:<br />
clrscr();<br />
insertar_ordenado();getch();break;</p>
<p>}</p>
<p>}while(opc!=’4′);</p>
<p>getch();</p>
<p>}</p>
<p>//INSERATAR AL INICIO<br />
void insertar_inicio()<br />
{<br />
clrscr();<br />
nodo *pAuxElem;<br />
nodo *recorre;<br />
pAuxElem=(tipoNodo*) malloc(sizeof(tipoNodo));<br />
while(recorre-&#62;siguiente!=NULL)<br />
{<br />
recorre=recorre-&#62;siguiente;<br />
}<br />
int n;<br />
gotoxy(20,20);<br />
cout&#60;&#60;”INGRESE VALOR  :\t”;<br />
cin&#62;&#62;n;<br />
pAuxElem-&#62;dato=n;<br />
pAuxElem-&#62;siguiente=cab;<br />
cab=pAuxElem;<br />
}</p>
<p>//INSERTAR AL FINAL<br />
void insertar_final()<br />
{<br />
clrscr();<br />
nodo *elem;<br />
elem=nuevo_elemento();<br />
clrscr();<br />
gotoxy(20,20);<br />
cout&#60;&#60;”INGRESE VALOR  :\t”;<br />
cin&#62;&#62;elem-&#62;dato;<br />
nodo *recorrer;<br />
recorrer=cab;<br />
while(recorrer-&#62;siguiente!=NULL)<br />
recorrer=recorrer-&#62;siguiente;<br />
recorrer-&#62;siguiente=elem;<br />
elem-&#62;siguiente=NULL;<br />
getch();<br />
}<br />
//INSERATAR ORDENADO<br />
void insertar_ordenado()<br />
{<br />
clrscr();<br />
nodo *pAuxElem;<br />
nodo *post;<br />
nodo *recorre;<br />
pAuxElem=(tipoNodo*) malloc(sizeof(tipoNodo));<br />
post=(tipoNodo*) malloc(sizeof(tipoNodo));<br />
int n;<br />
gotoxy(20,20);<br />
cout&#60;&#60;”INGRESE VALOR  :\t”;<br />
cin&#62;&#62;n;<br />
if(n&#60;cab-&#62;dato)<br />
{</p>
<p>post=cab-&#62;siguiente;<br />
while((pAuxElem-&#62;dato&#62;post-&#62;dato)&#38;&#38;(post-&#62;siguiente!=NULL))<br />
{<br />
post=post-&#62;siguiente;<br />
}<br />
if(post-&#62;siguiente!=NULL)<br />
{<br />
pAuxElem-&#62;siguiente=cab;<br />
cab=pAuxElem;<br />
}<br />
else<br />
{<br />
pAuxElem-&#62;siguiente=NULL;<br />
post-&#62;siguiente=pAuxElem;<br />
}</p>
<p>}<br />
else<br />
{<br />
while(recorre-&#62;siguiente!=NULL)<br />
{<br />
recorre=recorre-&#62;siguiente;<br />
}<br />
pAuxElem-&#62;dato=n;<br />
pAuxElem-&#62;siguiente=cab;<br />
cab=pAuxElem;<br />
}<br />
/*cout&#60;&#60;”Ingrese un numero”;<br />
cin&#62;&#62;n;<br />
if(n&#62;cab-&#62;dato)<br />
{<br />
insertar_inicio(n);<br />
}<br />
else<br />
{<br />
nodo *aux;<br />
nodo *ant;<br />
aux=cab-&#62;siguiente;<br />
while((aux!=NULL)(n&#62;aux-&#62;dato))<br />
{<br />
ant=aux;<br />
aux=aux-&#62;siguiente<br />
}<br />
nodo *nuevo;<br />
nuevo=crear_nuevo();<br />
nuevo-&#62;dato=n;<br />
ant-&#62;siguiente=nuevo;<br />
nuevo-&#62;siguiente=aux;<br />
}*/</p>
<p>}<br />
//PARA MODIFICAR<br />
void modificar()<br />
{<br />
clrscr();<br />
nodo *elem;<br />
nodo *ele;<br />
gotoxy(10,25);cout&#60;&#60;”ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n”;<br />
gotoxy(10,26);cout&#60;&#60;”º                          º\n”;<br />
gotoxy(10,27);cout&#60;&#60;”ºMODIFICAR NUMERO DE LISTA º\n”;<br />
gotoxy(10,28);cout&#60;&#60;”º                          º\n”;<br />
gotoxy(10,29);cout&#60;&#60;”ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼\n”;<br />
gotoxy(20,20);<br />
cout&#60;&#60;”INGRESE EL VALOR A MODIFICAR :\t”;<br />
cin&#62;&#62;elem-&#62;dato;<br />
nodo *recorrer;<br />
recorrer=cab;<br />
while(recorrer!=NULL)<br />
{</p>
<p>if(recorrer-&#62;dato==elem-&#62;dato)<br />
{<br />
clrscr();<br />
gotoxy(20,20);<br />
cout&#60;&#60;”INGRESE VALOR  :\t”;<br />
cin&#62;&#62;ele-&#62;dato;</p>
<p>recorrer-&#62;dato=ele-&#62;dato;<br />
}<br />
recorrer=recorrer-&#62;siguiente;</p>
<p>}<br />
getch();<br />
}<br />
//PARA BUSCAR<br />
void buscar()<br />
{<br />
clrscr();<br />
nodo *elem;<br />
gotoxy(10,25);cout&#60;&#60;”ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n”;<br />
gotoxy(10,26);cout&#60;&#60;”º                           º\n”;<br />
gotoxy(10,27);cout&#60;&#60;”ºBUSCADOR DE NUMERO DE LISTAº\n”;<br />
gotoxy(10,28);cout&#60;&#60;”º                           º\n”;<br />
gotoxy(10,29);cout&#60;&#60;”ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼\n”;<br />
gotoxy(20,20);<br />
cout&#60;&#60;”INGRESE EL VALOR A BUSCAR :\t”;<br />
cin&#62;&#62;elem-&#62;dato;<br />
nodo *recorrer;<br />
recorrer=cab;<br />
while(recorrer!=NULL)<br />
{</p>
<p>if(recorrer-&#62;dato==elem-&#62;dato)<br />
{<br />
clrscr();<br />
gotoxy(20,20);<br />
cout&#60;&#60;elem-&#62;dato&#60;&#60;”:\t”;<br />
cout&#60;&#60;”ESTE ELEMENTO SI EXISTE”;<br />
recorrer-&#62;dato=elem-&#62;dato;<br />
}</p>
<p>recorrer=recorrer-&#62;siguiente;</p>
<p>}</p>
<p>getch();<br />
}<br />
//ORDENAR<br />
void ordenar()<br />
{<br />
clrscr();<br />
char opc=’ ‘;</p>
<p>do<br />
{</p>
<p>clrscr();<br />
cuadro(1,10,25,56,’²’);<br />
gotoxy(13,3);cout&#60;&#60;”-&#62;[ ORDENAR  LAS LISTAS ENLAZADAS ]&#60;-\n”;<br />
gotoxy(12,6);cout&#60;&#60;”    MENU PRINCIPAL\n”;<br />
gotoxy(12,9); cout&#60;&#60;” [1]:  ORDENAR ASCENDENTE\n”;<br />
gotoxy(12,12);cout&#60;&#60;” [2]:  ORDENAR DESCENDENTE\n”;<br />
gotoxy(12,15);cout&#60;&#60;” [3]:  REGRESAR\n”;</p>
<p>gotoxy(12,17);cout&#60;&#60;” Elegir una Opci¢n [ ]“;<br />
gotoxy(32,17);cin&#62;&#62;opc;<br />
switch(opc)<br />
{<br />
case’1′:<br />
clrscr();<br />
ordenar_ascendente();getch();break;<br />
case’2′:<br />
clrscr();<br />
ordenar_descendente();getch();break;</p>
<p>}</p>
<p>}<br />
while(opc!=’3′);</p>
<p>getch();</p>
<p>}</p>
<p>void ordenar_ascendente()<br />
{<br />
nodo* aux;<br />
nodo* temp;<br />
int vaux;<br />
aux=(tipoNodo *)malloc(sizeof(tipoNodo));<br />
temp=(tipoNodo *)malloc(sizeof(tipoNodo));<br />
aux=cab;<br />
while (aux!=NULL)<br />
{<br />
temp=aux;<br />
while(temp-&#62;siguiente!=NULL)<br />
{<br />
temp=temp-&#62;siguiente;<br />
if(aux-&#62;dato&#62;temp-&#62;dato)<br />
{<br />
vaux=aux-&#62;dato;<br />
aux-&#62;dato=temp-&#62;dato;<br />
temp-&#62;dato=vaux;<br />
}<br />
}<br />
aux=aux-&#62;siguiente;<br />
}<br />
}</p>
<p>void ordenar_descendente()<br />
{<br />
nodo* aux;<br />
nodo* temp;<br />
int vaux;<br />
aux=(tipoNodo *)malloc(sizeof(tipoNodo));<br />
temp=(tipoNodo *)malloc(sizeof(tipoNodo));<br />
aux=cab;<br />
while (aux!=NULL)<br />
{<br />
temp=aux;<br />
while(temp-&#62;siguiente!=NULL)<br />
{<br />
temp=temp-&#62;siguiente;<br />
if(aux-&#62;dato&#60;temp-&#62;dato)<br />
{<br />
vaux=aux-&#62;dato;<br />
aux-&#62;dato=temp-&#62;dato;<br />
temp-&#62;dato=vaux;<br />
}<br />
}<br />
aux=aux-&#62;siguiente;<br />
}<br />
}<br />
//ELIMINAR<br />
void eliminar()<br />
{<br />
presentar();<br />
nodo *eliminar;<br />
//    nodo *recorrer;<br />
nodo *asigna;<br />
gotoxy(10,25);cout&#60;&#60;”ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n”;<br />
gotoxy(10,26);cout&#60;&#60;”º                          º\n”;<br />
gotoxy(10,27);cout&#60;&#60;”ºINSERTAR NUMERO A ELIMINARº\n”;<br />
gotoxy(10,28);cout&#60;&#60;”º                          º\n”;<br />
gotoxy(10,29);cout&#60;&#60;”ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼\n”;<br />
gotoxy(10,31);cout&#60;&#60;”Ingrese el n—mero a eliminar\t”;<br />
cin&#62;&#62;eliminar-&#62;dato;<br />
//    recorrer=cab;<br />
if (eliminar-&#62;dato==cab-&#62;dato)<br />
{</p>
<p>eliminar_cabeza();<br />
}</p>
<p>else<br />
{<br />
nodo *anterior=cab;<br />
nodo * aux=cab-&#62;siguiente;</p>
<p>while((aux!=NULL)&#38;&#38;(aux-&#62;dato!=eliminar-&#62;dato))<br />
{<br />
anterior=aux;<br />
aux=aux-&#62;siguiente;<br />
}<br />
if(aux!=NULL)<br />
{<br />
anterior-&#62;siguiente=aux-&#62;siguiente;<br />
aux-&#62;siguiente=NULL;<br />
free(aux);<br />
}<br />
else<br />
{<br />
gotoxy(10,33);<br />
cout&#60;&#60;”NO SE ENCUENTRA”;<br />
}<br />
}</p>
<p>}<br />
//ELIMINAR CABEZA<br />
void eliminar_cabeza()<br />
{<br />
nodo *aux;<br />
aux=cab;<br />
cab=cab-&#62;siguiente;<br />
aux-&#62;siguiente=NULL;<br />
free(aux);<br />
}<br />
//PRESENTAR LA LISTA<br />
void presentar()<br />
{<br />
clrscr();<br />
int f=10;<br />
nodo *recorrer;<br />
recorrer=cab;<br />
gotoxy(20,f);<br />
while(recorrer!=NULL)<br />
{<br />
gotoxy(20,f);<br />
cout&#60;&#60;recorrer-&#62;dato;<br />
cout&#60;&#60;”\n\n”;<br />
recorrer=recorrer-&#62;siguiente;<br />
f=f+2;<br />
}<br />
getch();</p>
<p>}<br />
//ESTA FUNCION PERMITE PRESENTAR LOS BORDES DE UN CUADRO<br />
void cuadro(int x1,int y1, int x2, int y2, char simb)<br />
{<br />
for (int i1=y1;i1&#60;=y2;i1++)<br />
{<br />
gotoxy(i1,x1);cout&#60;&#60;simb;<br />
gotoxy(i1,x2);cout&#60;&#60;simb;<br />
}<br />
for (int i2=x1;i2&#60;=x2;i2++)<br />
{<br />
gotoxy(y1,i2);cout&#60;&#60;simb;<br />
gotoxy(y2,i2);cout&#60;&#60;simb;<br />
}<br />
}
</p></description>
		</item>
		<item>
			<title>chicalight__ on "Dudas sobre listas simple y doblemente enlazadas en C"</title>
			<link>http://www.dudasprogramacion.com/topic/dudas-sobre-listas-simple-y-doblemente-enlazadas-en-c#post-188</link>
			<pubDate>Fri, 21 Aug 2009 03:05:47 +0000</pubDate>
			<dc:creator>chicalight__</dc:creator>
			<guid isPermaLink="false">188@http://www.dudasprogramacion.com/</guid>
			<description><p>Hola a todos, mi duda es la siguiente... no sé en que momento utilizar listas simples o dobles, yo por mi ocuparia puras simplemente enlazadas.. Esa es mi duda cuando es conveniente utilizar cada cual con ejemplos de casos por favorrr...<br />
por ejemplo si quiero hacer una lista de clientes en cierta consulta de un doctor en tal dia... conviene que sea simple o doble?'? en que casos seria mejor una doble?
</p></description>
		</item>
		<item>
			<title>Torres on "lista"</title>
			<link>http://www.dudasprogramacion.com/topic/lista#post-101</link>
			<pubDate>Fri, 17 Apr 2009 07:16:02 +0000</pubDate>
			<dc:creator>Torres</dc:creator>
			<guid isPermaLink="false">101@http://www.dudasprogramacion.com/</guid>
			<description><p>Buenas!</p>
<p>Mas que dudas de programación, da la sensación de que nos encargas un trabajo o una práctica...</p>
<p>Una lista es una lista, lo que hagas luego con ella es lo que simula un almacén, una tienda de motos o lo que sea...por otro lado el entorno de desarrollo (NetBeans, Eclipse, etc) no tiene nada que ver con la interfaz gráfica...lo único que existen algunos plugins para desarrollar de manera mas ágil y visual las aplicaciones.</p>
<p>Si pudieras concretar mas tu duda ayudaría bastante,</p>
<p>Un saludo.
</p></description>
		</item>
		<item>
			<title>spardatheone on "lista"</title>
			<link>http://www.dudasprogramacion.com/topic/lista#post-98</link>
			<pubDate>Tue, 14 Apr 2009 17:31:34 +0000</pubDate>
			<dc:creator>spardatheone</dc:creator>
			<guid isPermaLink="false">98@http://www.dudasprogramacion.com/</guid>
			<description><p>Una lista que describa la forma en que un almacen funciona(venta,compra,cantidad de objetos) y una forma simple de crear una interfase grafica en el programa netbeans si es posible.
</p></description>
		</item>

	</channel>
</rss>

