Which of the Following will define a type NODE that is a
node in a Linked list?
A)struct node {NODE*next;int x;};type def struct node NODE;
B)typedef struct NODE {struct NODE *next;int x;};
C)typedef struct NODE {NODE *next;int x;};
D)typedef struct {NODE *next;int x;}NODE;
Answer Posted / ashwin kumar
Shahzad is correct
next node must be like a 1st node means it must have two
fields one for two store data and another field for
storing address of the next node.
in 2nd field where we have point to the next node we must
store address of the next node , so we are using pointer ,
as we are pointing to a next node of type structure so we
must use
struct NODE *next
plz info me if any mistake in my answer
molugu.ashwin@gmail.com
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
define string ?
The file stdio.h, what does it contain?
Is fortran faster than c?
What is malloc() function?
What is the difference between exit() and _exit() function?
What is c++ used for today?
Why is struct padding needed?
Explain the difference between #include "..." And #include <...> In c?
If I have a char * variable pointing to the name of a function ..
Write a program to identify if a given binary tree is balanced or not.
What is the purpose of & in scanf?
Explain what are preprocessor directives?
Can you write a programmer for FACTORIAL using recursion?
Write a program for finding factorial of a number.
Can two or more operators such as and be combined in a single line of program code?