Algoritmia - Ordenacion de vectores por Radix y por cubetas

 
Vista:

Ordenacion de vectores por Radix y por cubetas

Publicado por Miguel (4 intervenciones) el 05/02/2002 14:38:51
Pues eso.
Alguien me puede ayudar con esos métodos de ordenación, o enviarme el código fuente?. Es la primera vez que los oigo y no tengo ni idea. Muchas gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Ordenacion de vectores por Radix y por cubetas

Publicado por Ivan (2 intervenciones) el 18/02/2002 05:31:19
list sort( r )
list r;

{
list head[M], tail[M];
int i, j, h;
for (i=D; i>0; i--) {
for (j=0; jk );
if ( head[h]==NULL ) head[h] = r;
else tail[h]->next = r;
tail[h] = r;
r = r->next;
};
/*** Concatenate lists ***/
r = NULL;
for (j=M-1; j>=0; j--)
if ( head[j] != NULL ) {
tail[j]->next = r;
r = head[j];
}
};
return( r );
};
Para un archivo bien explicado y el codigo completo y detallado explicado paso a paso mandame un mail
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Ordenacion de vectores por Radix y por cubetas

Publicado por aaron giiovanni reyna marquez (1 intervención) el 16/05/2011 14:37:53
oye envia me el codigo completo porfa gracias
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

RE:Ordenacion de vectores por Radix y por cubetas

Publicado por manuel_vzla (3 intervenciones) el 27/09/2012 20:50:10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#include<stdio.h>
void modifica_cubeta(int [],int ,int);
main()
{
      int i;
      int j;
int N;
   int z=0;
 
 printf("cantidad de elementos\n");
      scanf("%d",&N);
 
    int tem[N];
    int tem1[N];
    int Arreglo[N][10];
    int copia[10][10];
    int temp[N];
 
   int aux[N];
    int c[N];
 
 
    printf("introduzca los elementos\n");
            for(i=0;i<N;i++)
 
                 scanf("%d",& aux[i]);
 
 
      for(i=0;i<N;i++)
         c[i]=aux[i];
 
 
 
            for(j=0;j<10;j++)
                      for(i=0;i<N;i++)
                             Arreglo[i][j]=0;
 for(j=0;j<10;j++)
           for(i=0;i<10;i++)
            copia[i][j]=0;
 
  modifica_cubeta(aux,N,1);
 
  for(j=0;j<10;j++)
            for(i=0;i<N;i++)  {
 
     temp[i]=aux[i];
     //printf("%d  ",temp[i]);
 
     Arreglo[i][aux[i]]=c[i];
     tem[i]=Arreglo[i][j];
 
     if(Arreglo[i][j]>0){
       modifica_cubeta(tem,N,2);
     printf("%d  ",tem[i]);
      c[i]=Arreglo[i][j];
     copia[aux[i]][tem[i]]=c[i];
 
         }
 
 
}
 
for(j=0;j<10;j++)
            for(i=0;i<10;i++)  {
 
        if(i%10==0)
        printf("\n");
      printf("%3d  ",copia[i][j]);
        }
 
 
 
 
 
 
 system("pause");
 }
 
void modifica_cubeta(int b[],int n ,int pasada)
{
      int casilla;
   int i,j;
 
    int n_tem;
	int n_temp[10*n][10*n];
	int n_temp1[10*n][10*n];
 
 
 for(j=0;j<=10*n;j++)
 
         for(i=0;i<n;i++)
 
 
          {
 
        	n_tem=b[i];
 
 
			n_temp[i][j]=n_tem/10;
	        n_temp1[i][j]=n_tem%10;
 
 
 
			if(j>=1)
			{
 
	     		n_temp[i][j]=n_temp[i][j-1]/10;
 
             }
            if(j>=2){
 
 
  	       n_temp1[i][j-2]=	n_temp1[i][j];
		   n_temp1[i][j]=n_temp[i][j-2]%10;
 
           }
 
 
         if(j>0){
 
 
 
    if(j==pasada){
	       b[i]=n_temp1[i][j];
 
                 }
 
 
 
                }
 
 
 
 
 
 
 
 
       }
}
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Ordenacion de vectores por Radix y por cubetas

Publicado por Ivan (2 intervenciones) el 18/02/2002 05:31:49
list sort( r )
list r;

{
list head[M], tail[M];
int i, j, h;
for (i=D; i>0; i--) {
for (j=0; jk );
if ( head[h]==NULL ) head[h] = r;
else tail[h]->next = r;
tail[h] = r;
r = r->next;
};
/*** Concatenate lists ***/
r = NULL;
for (j=M-1; j>=0; j--)
if ( head[j] != NULL ) {
tail[j]->next = r;
r = head[j];
}
};
return( r );
};
Para un archivo bien explicado y el codigo completo y detallado explicado paso a paso mandame un mail
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Ordenacion de vectores por Radix y por cubetas

Publicado por irma (1 intervención) el 12/05/2007 23:34:22
quisiera sabes a que se refieren con una cubeta, y como puedo aplicar eso con lista ligadas
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

Ordenacion de vectores por Radix y por cubetas

Publicado por manuel_vzla (3 intervenciones) el 27/09/2012 20:46:35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#include<stdio.h>
void modifica_cubeta(int [],int ,int);
main()
{
      int i;
      int j;
int N;
   int z=0;
 
 printf("cantidad de elementos\n");
      scanf("%d",&N);
 
    int tem[N];
    int tem1[N];
    int Arreglo[N][10];
    int copia[10][10];
    int temp[N];
 
   int aux[N];
    int c[N];
 
 
    printf("introduzca los elementos\n");
            for(i=0;i<N;i++)
 
                 scanf("%d",& aux[i]);
 
 
      for(i=0;i<N;i++)
         c[i]=aux[i];
 
 
 
            for(j=0;j<10;j++)
                      for(i=0;i<N;i++)
                             Arreglo[i][j]=0;
 for(j=0;j<10;j++)
           for(i=0;i<10;i++)
            copia[i][j]=0;
 
  modifica_cubeta(aux,N,1);
 
  for(j=0;j<10;j++)
            for(i=0;i<N;i++)  {
 
     temp[i]=aux[i];
     //printf("%d  ",temp[i]);
 
     Arreglo[i][aux[i]]=c[i];
     tem[i]=Arreglo[i][j];
 
     if(Arreglo[i][j]>0){
       modifica_cubeta(tem,N,2);
     printf("%d  ",tem[i]);
      c[i]=Arreglo[i][j];
     copia[aux[i]][tem[i]]=c[i];
 
         }
 
 
}
 
for(j=0;j<10;j++)
            for(i=0;i<10;i++)  {
 
        if(i%10==0)
        printf("\n");
      printf("%3d  ",copia[i][j]);
        }
 
 
 
 
 
 
 system("pause");
 }
 
void modifica_cubeta(int b[],int n ,int pasada)
{
      int casilla;
   int i,j;
 
    int n_tem;
	int n_temp[10*n][10*n];
	int n_temp1[10*n][10*n];
 
 
 for(j=0;j<=10*n;j++)
 
         for(i=0;i<n;i++)
 
 
          {
 
        	n_tem=b[i];
 
 
			n_temp[i][j]=n_tem/10;
	        n_temp1[i][j]=n_tem%10;
 
 
 
			if(j>=1)
			{
 
	     		n_temp[i][j]=n_temp[i][j-1]/10;
 
             }
            if(j>=2){
 
 
  	       n_temp1[i][j-2]=	n_temp1[i][j];
		   n_temp1[i][j]=n_temp[i][j-2]%10;
 
           }
 
 
         if(j>0){
 
 
 
    if(j==pasada){
	       b[i]=n_temp1[i][j];
 
                 }
 
 
 
                }
 
 
 
 
 
 
 
 
       }
}
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

Ordenacion de vectores por Radix y por cubetas

Publicado por manuel_vzla (3 intervenciones) el 27/09/2012 20:48:55
por cierto esta es una version ...de el problema que aparece en el deitel&&deitel..

como parte de un aporte a la comunidad..


y bueno aunque tarde .....quizas a alguien le pueda servir....

a la orden desde venezuela...

saludos....
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar