Professional Documents
Culture Documents
58. is a linked list which always contains a special node at beginning of the list
(a) Singly linked list (b) Doubly linked list
(c) Header linked list (d) All the above
Answer The following questions(59-60) based on the code given below
typedef struct node
{
int data;
struct node *next;
}NODE;
NODE *ptr, *temp=NULL; int i;
for(i=1;i<=4;i++)
{
ptr=(NODE *)malloc(sizeof(NODE));
ptr->data=i*10;
ptr->next=temp
temp=ptr;
}
while(temp!=NULL)
{
printf(“%d “,temp->data);
temp=temp->next;
}
Answer The following questions (61-62) based on the code given below
typedef struct node
{
int data;
struct node *next;
}NODE;
NODE *ptr, *temp=NULL; int i;
for(i=1;i<=4;i++)
{
ptr=(NODE *)malloc(sizeof(NODE));
ptr->data=i*10;
ptr->next=temp
temp=ptr;
}
while(temp!=NULL)
{
printf(“%d “,temp->data);
temp=temp->next->next;
}
1. (c) 2. (d) 3. (d) 4. (d) 5. (a) 6. (c) 7. (c) 8. (c) 9. (a) 10. (b)
11. (a) 12. (d) 13. (c) 14. (c) 15. (c) 16. (c) 17. (b) 18. (a) 19. (c) 20. (b)
21. (b) 22. (a) 23. (a) 24. (a) 25. (b) 26. (b) 27. (c) 28. (a) 29. (a) 30. (d)
31. (b) 32. (a) 33. (b) 34. (a) 35. (c) 36. (a) 37. (a) 38. (c) 39. (c) 40. (c)
41. (a) 42. (a) 43. (c) 44. (c) 45. (d) 46. (c) 47. (a) 48. (a) 49. (c) 50. (a)
51. (a) 52. (b) 53. (b) 54. (a) 55. (c) 56. (c) 57. (b) 58. (c) 59. (a) 60. (b)
61. (a) 62. (b) 63. (b) 64. (b) 65. (a)