Código de ordenação bogosort 0 #include <stdio.h> #include <time.h> #include <stdlib.h> #include <sys/time.h> int isordered( int vec[], int len) { int i; for (i=0; i<len-1; i++) if (vec[i] > vec[i+1]) return 0; return 1; } void bogosort( int vec[], int len) { int i, r, tmp; int iter = 0; while (!isordered(vec, len)) { for (i=0; i<len-1; i++) { r = rand()%len; tmp = vec[i]; vec[i] = vec[r]; vec[r] = tmp; } printf( "rIterations: %d" , ++iter); fflush(stdout); } printf( "n" ); } int main( int argc, char **argv) { int i; int *vec; struct timeval *t; if (argc < 2) { printf( "Usage: bogosort num...n" ); return 1; } if (!( vec = malloc((argc-1) * sizeof ( int )) )) { printf( "-- Error allocating memory!n" ); r...