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


Please Help Members By Posting Answers For Below Questions

What are the advantages and disadvantages of a heap?

718


What is static function in c?

641


Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.

3700


Differentiate between calloc and malloc.

771


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

771






Are local variables initialized to zero by default in c?

559


How many levels of indirection in pointers can you have in a single declaration?

605


Do variables need to be initialized?

627


In which language linux is written?

609


Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014  Npu university

1607


When a c file is executed there are many files that are automatically opened what are they files?

600


What are compound statements?

641


writ a program to compare using strcmp VIVA and viva with its output.

1538


Differentiate between Macro and ordinary definition.

740


What is far pointer in c?

821