Question: // put all numbers of array A to linked list #include #include typedef struct node* nptr; typedef struct node { int data; nptr link; }

// put all numbers of array A to linked list

#include #include

typedef struct node* nptr; typedef struct node { int data; nptr link; } NODE;

void Insert(NODE*, int); void PrintAll(nptr);

int main() { // Init int A[10] = { 3, 9, 8, 2, 5, 10, 7, 1, 4, 6 }; NODE *p = (NODE*)malloc(10 * sizeof(NODE)); (p + 9)->link = NULL; for (int i = 0; i < 10 - 1; ++i) (p + i)->link = p + i + 1;

return 0; }

void Insert(NODE* p, int n) { }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!