if i write the below code what will be the initial values of 2-D matrix and why?
int *adjmatrix=new int[v];
for(int i=0;i<v;i++){
adjmatrix[i]=new int[v]{INT_MAX};
}
here v is the number of vertices in the graph
if i write the below code what will be the initial values of 2-D matrix and why?
int *adjmatrix=new int[v];
for(int i=0;i<v;i++){
adjmatrix[i]=new int[v]{INT_MAX};
}
here v is the number of vertices in the graph
@Rj.25 for every row first val intmax rest 0. in this way of initializing you can just do all 0 but not other than it.
i hope its cleared if yes dont forget to mark it as resolved and hit like 
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.