C function is a linked list empty
#include <stdio.h>
#include <stdlib.h>
struct Node {
int data;
struct Node* next;
};
int isListEmpty(struct Node* head);
int main() {
struct Node* head = NULL;
if (isListEmpty(head)) {
printf("Linked list is empty.\n");
} else {
printf("Linked list is not empty.\n");
}
return 0;
}
int isListEmpty(struct Node* head) {
return (head == NULL);
}