week 2 clang-format
This commit is contained in:
@@ -71,7 +71,8 @@ int DeleteNode(Node **phead, double x) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* if not the first node */
|
/* if not the first node */
|
||||||
for (pnode=*phead, position=2; pnode->next; pnode=pnode->next, position++) {
|
for (pnode = *phead, position = 2; pnode->next;
|
||||||
|
pnode = pnode->next, position++) {
|
||||||
/* loop for pnode->next->data == x */
|
/* loop for pnode->next->data == x */
|
||||||
if (pnode->next->data == x) {
|
if (pnode->next->data == x) {
|
||||||
/* delete node */
|
/* delete node */
|
||||||
@@ -89,7 +90,7 @@ int DeleteNode(Node **phead, double x) {
|
|||||||
void DisplayList(Node *head) {
|
void DisplayList(Node *head) {
|
||||||
Node *pnode;
|
Node *pnode;
|
||||||
/* loop for each node */
|
/* loop for each node */
|
||||||
for (pnode=head; pnode; pnode=pnode->next) {
|
for (pnode = head; pnode; pnode = pnode->next) {
|
||||||
printf("%f ", pnode->data);
|
printf("%f ", pnode->data);
|
||||||
}
|
}
|
||||||
/* new line at the end */
|
/* new line at the end */
|
||||||
|
|||||||
Reference in New Issue
Block a user