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
What are the advantages and disadvantages of a heap?
What is static function in c?
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.
Differentiate between calloc and malloc.
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
Are local variables initialized to zero by default in c?
How many levels of indirection in pointers can you have in a single declaration?
Do variables need to be initialized?
In which language linux is written?
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
When a c file is executed there are many files that are automatically opened what are they files?
What are compound statements?
writ a program to compare using strcmp VIVA and viva with its output.
Differentiate between Macro and ordinary definition.
What is far pointer in c?