#include "stdio.h"
#include "math.h"
typedef struct Node
{
DataType data;
struct Node *next;
}SLNode;
void ListInitiate(SLNode **head)
{
*head = (SLNode *)malloc(sizeof(SLNode));
(*head)->next = NULL;
}
int ListLength(SLNode *head)
{
SLNode *p = head;
int size = 0;
while(p->next !=NULL)
{
p = p->next;
size++;
}
#include "math.h"
typedef struct Node
{
DataType data;
struct Node *next;
}SLNode;
void ListInitiate(SLNode **head)
{
*head = (SLNode *)malloc(sizeof(SLNode));
(*head)->next = NULL;
}
int ListLength(SLNode *head)
{
SLNode *p = head;
int size = 0;
while(p->next !=NULL)
{
p = p->next;
size++;
}