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;
Answers were Sorted based on User's Feedback
Answer / shahzad
B)
coz ..linked list node contain two parts ..
one is address to next node
other is data part in single list....
writting keyword struct before NODE is must..
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / gorgeousgirl
all the four given options throws error...
the correct answer should be:
typedef struct node NODE;
struct node {NODE*next;int x;};
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / 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 |
Answer / vikraman85
B is the answer..
b'coz in struct node *next only specify the address of the
next node.. others not..
| Is This Answer Correct ? | 3 Yes | 2 No |
write a program to print data of 5 five students with structures?
Write a C++ program without using any loop (if, for, while etc) to print numbers from 1 to 100 and 100 to 1;
18 Answers Accenture, Cisco, Egentec, HCL, Ideaz, Infosys, M-Systems, MYR, TCS,
Write a program to check armstrong number in c?
How does free() know how many bytes to free?
control 50 devices which has 2 states on and off.using bitwise operator.plz answer it its urgent
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
wats the diference btwen constant pointer and pointer to a constant.pls give examples.
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }
Can you tell me how to check whether a linked list is circular?
Is anything faster than c?
print the pattern 1 2 4 3 6 9 4 8 12 16 5 10 15 20 25 if n=5