Thursday, 6 December 2018

Take a look at my live stream: '⭕🔴🔵 PUBG Mobile Live Again🔺🔴#PUBG is Life' at https://gaming.youtube.com/c/KingAnupamDutta/live

Thursday, 15 November 2018

WRITE DOWN A C PROGRAM TO INSERT IN BEGINNING & END, DELETE A NODE IN BEGINNING & END, TRAVERSE FOR THE CIRCULAR - SINGLY LINKED LIST (C-SLL) AND ALSO MODIFY A SPECIFIED NODE FOR THE CIRCULAR - SINGLY LINKED LIST (C-SLL) USING GLOBAL START VARIABLE & CALL BY REFERENCE & BY USING THE SWITCH CASE.

WRITE DOWN A C PROGRAM TO INSERT IN BEGINNING & END, DELETE A NODE IN BEGINNING & END, TRAVERSE FOR THE CIRCULARSINGLY LINKED LIST (C-SLL) AND ALSO MODIFY A SPECIFIED NODE FOR THE CIRCULAR - SINGLY LINKED LIST (C-SLL) USING GLOBAL START VARIABLE & CALL BY REFERENCE & BY USING THE SWITCH CASE.


  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <malloc.h>
  4. struct node 
  5. {
  6. int data;
  7. struct node *next;
  8. };
  9. struct node *start=NULL;
  10. void create_nodebegining(int);
  11. void create_nodeend(int);
  12. void delete_nodebegining();
  13. void delete_nodeend();
  14. void modify(int,int);
  15. void traverse();
  16. int main()
  17. {
  18. int data,i,n,ch,data1;
  19. printf("\n Enter The Value of data to be Entered:\n");
  20. scanf("%d",&n);
  21. for(i=0;i<n;i++)
  22. {
  23. printf("\n Enter The Value Should be Enter In Data of Node:\n");
  24. scanf("%d",&data);
  25. create_nodeend(data);
  26. }
  27. printf("\n Please Enter Your Choise \n ");
  28. printf("\n Press 1 for Insert in Beginning \n Press 2 for Insert in end \n Press 3 Delete in Beginning \n Press 4 for delete in end \n Press 5 for modify \n press 6 for traverse \n");
  29. scanf("%d",&ch);
  30. switch(ch)
  31. {
  32. case 1:
  33. printf("\n Enter The Value For Node Data:\n");
  34. scanf("%d",&data);
  35. create_nodebegining(data);
  36. break;
  37. case 2:
  38. printf("\n Enter The Value For Node Data:\n");
  39. scanf("%d",&data);
  40. create_nodeend(data);
  41. break;
  42. case 3:
  43. delete_nodebegining();
  44. break;
  45. case 4:
  46. delete_nodeend();
  47. break;
  48. case 5:
  49. printf("\n Enter The Data To be Modified:\n");
  50. scanf("%d",&data1);
  51. printf("\n Enter The Data Modified:\n");
  52. scanf("%d",&data);
  53. modify(data1,data);
  54. break;
  55. case 6:
  56. traverse();
  57. break;
  58. }
  59. traverse();
  60. }
  61. void create_nodeend(int x)
  62. {
  63. struct node *t,*t1;
  64. t=(struct node*)malloc(sizeof(struct node));
  65. t->data=x;
  66. t->next=NULL;
  67. if(start==NULL)
  68. {
  69. start=t;
  70. t->next=start;
  71. }
  72. else
  73. {
  74. t1=start;
  75. while(t1->next!=start)
  76. {
  77. t1=t1->next;
  78. }
  79. t->next=start;
  80. t1->next=t;
  81. }
  82. }
  83. void create_nodebegining(int x)
  84. {
  85. struct node *t,*t1;
  86. t=(struct node*)malloc(sizeof(struct node));
  87. t1=start;
  88. t->data=x;
  89. t->next=t1;
  90. while(t1->next!=start)
  91. {
  92. t1=t1->next;
  93. }
  94. start=t;
  95. t1->next=start;
  96. traverse();
  97. }
  98. void delete_nodeend()
  99. {
  100. struct node *t,*t1;
  101. t=start;
  102. while(t->next!=start)
  103. {
  104. t1=t;
  105. t=t->next;
  106. }
  107. free(t);
  108. t1->next=start;
  109. traverse();
  110. }
  111. void delete_nodebegining()
  112. {
  113. struct node *t,*t1=start;
  114. t=start->next;
  115. while(t1->next!=start)
  116. {
  117. t1=t1->next;
  118. }
  119. free(start);
  120. start=t;
  121. t1->next=start;
  122. traverse();
  123. }
  124. void modify(int x,int y)
  125. {
  126. struct node *t;
  127. t=start;
  128. while(t->data!=x)
  129. {
  130. t=t->next;
  131. }
  132. t->data=y;
  133. traverse();
  134. }
  135. void traverse()
  136. {
  137. struct node *t;
  138. t=start;
  139. while(t->next!=start)
  140. {
  141. printf("\n %d",t->data);
  142. t=t->next;
  143. }
  144. printf("\n %d\n\n",t->data);
  145. }

WRITE DOWN A C PROGRAM TO INSERT IN BEGINNING & END, DELETE A NODE IN BEGINNING & END, TRAVERSE FOR THE CIRCULAR - DOUBLY LINKED LIST (C-DLL) AND ALSO MODIFY A SPECIFIED NODE FOR THE CIRCULAR - DOUBLY LINKED LIST USING GLOBAL START VARIABLE & CALL BY REFERENCE & BY USING THE SWITCH CASE.

WRITE DOWN A C PROGRAM TO INSERT IN BEGINNING & END, DELETE A NODE IN BEGINNING & END, TRAVERSE FOR THE Circular - DOUBLY LINKED LIST (C-DLL) AND ALSO MODIFY A SPECIFIED NODE FOR THE CIRCULAR - DOUBLY LINKED LIST USING GLOBAL START VARIABLE & CALL BY REFERENCE & BY USING THE SWITCH CASE.

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <malloc.h>
  4. struct node 
  5. {
  6. struct node *prev;
  7. int data;
  8. struct node *next;
  9. };
  10. struct node *start=NULL;
  11. void create_nodebegining(int);
  12. void create_nodeend(int);
  13. void delete_nodebegining();
  14. void delete_nodeend();
  15. void modify(int,int);
  16. void traverse();
  17. int main()
  18. {
  19. int data,i,n,ch,data1;
  20. printf("\n Enter The Value of data to be Entered:\n");
  21. scanf("%d",&n);
  22. for(i=0;i<n;i++)
  23. {
  24. printf("\n Enter The Value Should be Enter In Data of Node:\n");
  25. scanf("%d",&data);
  26. create_nodeend(data);
  27. }
  28. printf("\n Please Enter Your Choise \n ");
  29. printf("\n Press 1 for Insert in Beginning \n Press 2 for Insert in end \n Press 3 Delete in Beginning \n Press 4 for delete in end \n Press 5 for modify \n press 6 for traverse \n");
  30. scanf("%d",&ch);
  31. switch(ch)
  32. {
  33. case 1:
  34. printf("\n Enter The Value For Node Data:\n");
  35. scanf("%d",&data);
  36. create_nodebegining(data);
  37. break;
  38. case 2:
  39. printf("\n Enter The Value For Node Data:\n");
  40. scanf("%d",&data);
  41. create_nodeend(data);
  42. break;
  43. case 3:
  44. delete_nodebegining();
  45. break;
  46. case 4:
  47. delete_nodeend();
  48. break;
  49. case 5:
  50. printf("\n Enter The Data To be Modified:\n");
  51. scanf("%d",&data1);
  52. printf("\n Enter The Data Modified:\n");
  53. scanf("%d",&data);
  54. modify(data1,data);
  55. break;
  56. case 6:
  57. traverse();
  58. break;
  59. }
  60. traverse();
  61. }
  62. void create_nodeend(int x)
  63. {
  64. struct node *t,*t1;
  65. t=(struct node*)malloc(sizeof(struct node));
  66. t->prev=NULL;
  67. t->data=x;
  68. t->next=NULL;
  69. if(start==NULL)
  70. {
  71. start=t;
  72. t->next=start;
  73. start->prev=t;
  74. }
  75. else
  76. {
  77. t1=start;
  78. while(t1->next!=start)
  79. {
  80. t1=t1->next;
  81. }
  82. t->next=start;
  83. t->prev=t1;
  84. t1->next=t;
  85. start->prev=t;
  86. }
  87. }
  88. void create_nodebegining(int x)
  89. {
  90. struct node *t,*t1;
  91. t1=start;
  92. t=(struct node*)malloc(sizeof(struct node));
  93. t->prev=NULL;
  94. t->data=x;
  95. t->next=NULL;
  96. while(t1->next!=start)
  97. {
  98. t1=t1->next;
  99. }
  100. start->prev=t;
  101. t->next=start;
  102. start=t;
  103. t1->next=start;
  104. t->prev=t1;
  105. traverse();
  106. }
  107. void delete_nodeend()
  108. {
  109. struct node *t,*t1;
  110. t=start;
  111. while(t->next!=start)
  112. {
  113. t1=t;
  114. t=t->next;
  115. }
  116. free(t);
  117. t1->next=start;
  118. traverse();
  119. }
  120. void delete_nodebegining()
  121. {
  122. struct node *t,*t1;
  123. t1=start;t=start;
  124. while(t1->next!=start)
  125. {
  126. t1=t1->next;
  127. }
  128. free(start);
  129. start=t->next;
  130. start->prev=t1;
  131. t1->next=start;
  132. traverse();
  133. }
  134. void modify(int x,int y)
  135. {
  136. struct node *t;
  137. t=start;
  138. while(t->data!=x)
  139. {
  140. t=t->next;
  141. }
  142. t->data=y;
  143. traverse();
  144. }

  145. void traverse()
  146. {
  147. struct node *t;
  148. t=start;
  149. while(t->next!=start)
  150. {
  151. printf("\n %d",t->data);
  152. t=t->next;
  153. }
  154. printf("\n %d\n\n",t->data);
  155. }

Write down a C Program to insert in beginning & end, delete a node in beginning & end, Traverse for the Doubly Linked List and also modify a specified node for the Doubly Linked List using Global start variable & call by reference & by using the Switch Case.

Write down a C Program to insert in beginning & end, delete a node in beginning & end, Traverse for the Doubly Linked List and also modify a specified node for the Doubly Linked List using Global start variable & call by reference & by using the Switch Case.

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <malloc.h>
  4. struct node 
  5. {
  6. struct node *prev;
  7. int data;
  8. struct node *next;
  9. };
  10. struct node *start=NULL;
  11. void create_nodebegining(int);
  12. void create_nodeend(int);
  13. void delete_nodebegining();
  14. void delete_nodeend();
  15. void modify(int,int);
  16. void traverse();
  17. int main()
  18. {
  19. int data,i,n,ch,data1;
  20. printf("\n Enter The Value of data to be Entered:\n");
  21. scanf("%d",&n);
  22. for(i=0;i<n;i++)
  23. {
  24. printf("\n Enter The Value Should be Enter In Data of Node:\n");
  25. scanf("%d",&data);
  26. create_nodeend(data);
  27. }
  28. printf("\n Please Enter Your Choise \n ");
  29. printf("\n Press 1 for Insert in Beginning \n Press 2 for Insert in end \n Press 3 Delete in Beginning \n Press 4 for delete in end \n Press 5 for modify \n press 6 for traverse \n");
  30. scanf("%d",&ch);
  31. switch(ch)
  32. {
  33. case 1:
  34. printf("\n Enter The Value For Node Data:\n");
  35. scanf("%d",&data);
  36. create_nodebegining(data);
  37. break;
  38. case 2:
  39. printf("\n Enter The Value For Node Data:\n");
  40. scanf("%d",&data);
  41. create_nodeend(data);
  42. break;
  43. case 3:
  44. delete_nodebegining();
  45. break;
  46. case 4:
  47. delete_nodeend();
  48. break;
  49. case 5:
  50. printf("\n Enter The Data To be Modified:\n");
  51. scanf("%d",&data1);
  52. printf("\n Enter The Data Modified:\n");
  53. scanf("%d",&data);
  54. modify(data1,data);
  55. break;
  56. case 6:
  57. traverse();
  58. break;
  59. }
  60. traverse();
  61. }
  62. void create_nodeend(int x)
  63. {
  64. struct node *t,*t1;
  65. t=(struct node*)malloc(sizeof(struct node));
  66. t->prev=NULL;
  67. t->data=x;
  68. t->next=NULL;
  69. if(start==NULL)
  70. {
  71. start=t;
  72. }
  73. else
  74. {
  75. t1=start;
  76. while(t1->next!=NULL)
  77. {
  78. t1=t1->next;
  79. }
  80. t1->next=t;
  81. t->prev=t1;
  82. }
  83. }
  84. void create_nodebegining(int x)
  85. {
  86. struct node *t,*t1;
  87. t1=start;
  88. t=(struct node*)malloc(sizeof(struct node));
  89. t->prev=NULL;
  90. t->data=x;
  91. t->next=t1;
  92. t1->prev=t;
  93. start=t;
  94. traverse();
  95. }
  96. void delete_nodeend()
  97. {
  98. struct node *t,*t1;
  99. t=start;
  100. while(t->next!=NULL)
  101. {
  102. t1=t;
  103. t=t->next;
  104. }
  105. free(t);
  106. t1->next=NULL;
  107. traverse();
  108. }
  109. void delete_nodebegining()
  110. {
  111. struct node *t,*t1;
  112. t1=start;
  113. start=t1->next;
  114. start->prev=NULL;
  115. traverse();
  116. }
  117. void modify(int x,int y)
  118. {
  119. struct node *t;
  120. t=start;
  121. while(t->data!=x)
  122. {
  123. t=t->next;
  124. }
  125. t->data=y;
  126. traverse();
  127. }

  128. void traverse()
  129. {
  130. struct node *t;
  131. t=start;
  132. while(t->next!=NULL)
  133. {
  134. printf("\n %d",t->data);
  135. t=t->next;
  136. }
  137. printf("\n %d\n\n",t->data);
  138. while(t->prev!=NULL)
  139. {
  140. printf("\n %d",t->data);
  141. t=t->prev;
  142. }
  143. printf("\n %d\n\n",t->data);
  144. }