Question: Which of the following C language code is used to create a new node in the singly linear linked list. A. ptr = (LIST*) malloc(sizeof(LIST));

Which of the following C language code is used to create a new node in the singly linear linked list.

{ } struct node int data; struct node * next; typedef struct

A. ptr = (LIST*) malloc(sizeof(LIST));

B. *ptr = (LIST*) malloc(LIST);

C. ptr = (LIST*) malloc(sizeof(LIST*));

D. ptr = (LIST) malloc(sizeof(LIST));

{ } struct node int data; struct node * next; typedef struct node LIST; LIST*ptr;

Step by Step Solution

3.46 Rating (159 Votes )

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 Data Structures and Other Objects Using Java Questions!