Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- typedef struct node node;
- struct node {
- int value;
- node* link;
- };
- node* pushBack(node* tail, int value) {
- /*to do*/
- }
- void printCircularList(node* tail) {
- /*to do*/
- }
- node* deleteNode(node * tail, int value) {
- /*to do*/
- }
- node* concatenateCircularList(node * tailA, node * tailB) {
- /*to do*/
- }
- int main() {
- node* a = NULL, * b = NULL;
- FILE* fp = fopen("A.txt", "r");
- for (int t; ~fscanf(fp, "%d", &t); )
- a = pushBack(a, t);
- fclose(fp);
- fp = fopen("B.txt", "r");
- for (int t; ~fscanf(fp, "%d", &t); )
- b = pushBack(b, t);
- fclose(fp);
- node * d = concatenateCircularList(a, b);
- printCircularList(d);
- puts("");
- fp = fopen("C.txt", "r");
- for (int t; ~fscanf(fp, "%d", &t); ) {
- d = deleteNode(d, t);
- }
- fclose(fp);
- printCircularList(d);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement