Skip to content

Commit

Permalink
Fix bugs: single_list.c has some grammer errors.Fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperChenSSS committed Oct 7, 2018
1 parent c7e3a1b commit 5ce1e24
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions c-cpp/06_linkedlist/single_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void insert_head(struct single_list_head *head, struct single_list *elem)
insert(&head->head, elem);
}

struct single_list* delete(struct single_list **prev)
struct single_list* del(struct single_list **prev)
{
struct single_list *tmp;

Expand All @@ -53,12 +53,12 @@ struct single_list* delete(struct single_list **prev)
tmp->next = NULL;

return tmp;
}
};

struct single_list* delete_head(struct single_list_head* head)
{
return delete(&head->head);
}
return del(&head->head);
};

struct single_list** search(struct single_list_head* head, int target)
{
Expand All @@ -70,7 +70,7 @@ struct single_list** search(struct single_list_head* head, int target)
;

return prev;
}
};

void reverse(struct single_list_head* head)
{
Expand Down Expand Up @@ -117,7 +117,7 @@ struct single_list* middle(struct single_list_head* head)
}

return NULL;
}
};

int main()
{
Expand Down Expand Up @@ -153,7 +153,7 @@ int main()
else
printf("The list not contains 2\n");

delete(prev);
del(prev);
prev = search(&head, 2);
printf("After remove 2\n");
if ((*prev) && ((*prev)->val == 2))
Expand All @@ -173,4 +173,3 @@ int main()

return 0;
}

0 comments on commit 5ce1e24

Please sign in to comment.