Advertisement
Guest User

Untitled

a guest
May 25th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. typedef struct node node;
  4. struct node {
  5. int value;
  6. node* link;
  7. };
  8. node* pushBack(node* tail, int value) {
  9. /*to do*/
  10. }
  11. void printCircularList(node* tail) {
  12. /*to do*/
  13. }
  14.  
  15. node* deleteNode(node * tail, int value) {
  16. /*to do*/
  17. }
  18. node* concatenateCircularList(node * tailA, node * tailB) {
  19. /*to do*/
  20. }
  21. int main() {
  22. node* a = NULL, * b = NULL;
  23. FILE* fp = fopen("A.txt", "r");
  24. for (int t; ~fscanf(fp, "%d", &t); )
  25. a = pushBack(a, t);
  26. fclose(fp);
  27. fp = fopen("B.txt", "r");
  28. for (int t; ~fscanf(fp, "%d", &t); )
  29. b = pushBack(b, t);
  30. fclose(fp);
  31.  
  32. node * d = concatenateCircularList(a, b);
  33. printCircularList(d);
  34. puts("");
  35. fp = fopen("C.txt", "r");
  36. for (int t; ~fscanf(fp, "%d", &t); ) {
  37. d = deleteNode(d, t);
  38. }
  39. fclose(fp);
  40. printCircularList(d);
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement