hello i have a project i'm stuck at i'm not really good with C++ so please help me
i did a two 2d array that the user define it size and adds(Both same) the number it hold and adds both numbers or the 2 arrays in a new 2d array, my problem is this :
i need to show the user the 3rd array in a linked list format
i can show it in that for loop but when i told the teacher he said linked list only.
i dont know how.
please help me.
this is the code
1 2 3 4 5 6 7 8
int array3[x][y];
for(int i=0;i<x;i++) // for Loop of all the elements [array1+array2]
{
for(int j=0;j<y;j++)
{
array3[x][y]=array1[x][y]+array2[x][y];
}
}
I don't understand what you really mean. Are you supposed to be converting these arrays into linked-lists? If you are just supposed to iterate over a linked-list, it goes like this
1 2 3 4 5 6 7 8 9
// !! Pseudo-Code !!
Item it = linked-list.head();
while(it.isValid()){
//do some stuff
//goto next element
it = it.nextInList();
}