User Profile
Collapse
-
Game Of Life 3D
I had to implement Game of Life in a 3D matrix (int a[ ][ ][ ]) , but the complexity of my implementation is O(n^6) (6 imbricated for) and it runs very slow . Can anyone help me with an optimized version of Game of life , even with a 2D matrix . Or how the Game of Life in general could be optimized ? -
got it 10x , correct me if i'm wrong .. .....
void change(int **x, int **y){*x=*y;}
int main(){
int *xx,*yy;
yy = (int*)malloc(si zeof(int));
change(&xx,&yy) ;
if(xx == NULL)printf("is null\n");
else printf("---- %d ----\n",*xx);... -
change(int*x , int* y){*x=*y;}
main(){
int x,y;
y=7;
change(&x,&y);
}
to be similar to the one with pointers , i would do it this way...Leave a comment:
-
then how can i copy the value of one pointer argument into another pointer argument ?
xx = yy must be done in a function . the original program is much complex and it has to be done that way .Leave a comment:
-
hi , i'm having a problem with pointers in C ...
I will give a simple example inspired from my problem :
void change(int *x, int *y){x=y;}
int main(){
int *xx,*yy;
yy = (int*)malloc(si zeof(int));
change(xx,yy);
if(xx == NULL)printf("is null\n");
else printf("---- %d ----\n",*xx);
............... ............... ............... ..............
xx doesn't...
No activity results to display
Show More
Leave a comment: