Is it possible to print an array of nodes? I need to display the AVL tree as it is being built, but whenever I run this code, the program crashes. Any alternative ways around this?
int k = 0;
t = NULL;
node* nodearray[32];
for( j = 0; j < 33; j++)
{
printf ("Table %d \n", j+1);
printf ("LineNum Left Data Right\n");
t = Insert(j, a[j], t );
for (k= 0 ; k < j ; k ++)
{
printf ("%5d %5d %5d %5d", nodearray[k]->num, nodearray[k]->left->data, nodearray[k]->data, nodearray[k]-> right ->data);
}
}