Pregunta: | 67572 - VOID NO IGNORED AS IT OUGHT TO BE |
Autor: | Leonardo Casallas |
char Menu() {char op; cout<<" MENU "; cout<<"(C)argar "; cout<<"(M)ostrar "; cout<<"(B)uscar "; cout<<"B(U)rbuja "; cout<<"(Q)uicksort "; cout<<"(I)nsercion "; cout<<"S(H)eel "; cout<<"(R)adixsort o cubetas "; cout<<"(S)alir "; cout<<"Seleccione su opcion:"; cin>>op; return op; } int main() {int n, elem, pos, operaciones; char opcion='*'; cout<<"De que tamaño quiere el arreglo: "; cin>>n; Arreglo A(n),B(n); while (opcion!='s' && opcion!='S') { switch (opcion) case 'i': case 'I': B=A; operaciones=B.Insercion(); cout<<"El arreglo ordenado por Insercion, ha realizando: "<<operaciones<<" Comparaciones "; B.Mostrar(); break; void Arreglo::Quicksort (int lo, int ho) { int t, l=lo, h=ho, mid; if (ho>lo) { mid=Elemento[(lo+ho)/2]; while (l<h) {while (l<ho && Elemento[l]<mid)++l; while (h>lo && Elemento[h]>mid)--h; if (l<=h) { t=Elemento[l]; Elemento[l]=Elemento[h]; Elemento[h]=t; ++l; --h; } } if(lo<h)Quicksort(lo,h); if(l<ho)Quicksort(l ,ho); } } void Arreglo::Quicksort() {Quicksort(0,Tamano-1);} int Arreglo::Shell() {int k=Tamano/2; int cont=0; while(k>=1){ for (int subarray=0; subarray<k; subarray++){ for(int i=k+subarray; i<a.lenght;i+=k;){ int v = Elemento[i]; int j = i-k; cont ++; while(j>=0 && Elemento[j]>v){ cont++; Elemento[j+k]=Elemento[j]; } Elemento[j+k]=v; } k/2; } return cont; } tengo este código pero me sale un error al llmar la función desde while (opcion!='s' && opcion!='S') { switch (opcion) case 'i': case 'I': B=A;/// AQUI MAS EXACTA MENTE ME GENERA EL ERROR operaciones=B.Insercion(); cout<<"El arreglo ordenado por Insercion, ha realizando: "<<operaciones<<" Comparaciones "; B.Mostrar(); break; MEDICE EL DEV C++ QUE "VOID NO IGNORED AS IT OUGHT TO BE", REAL MENTE NO SE QUE HACER CON ESE ERROR |