大概相当于二维数组,主链表存行,子链表存列
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define success 0
#define fail -1
typedef struct infoin//子链信息
{
int row;
} infoin;
typedef struct nodein//子链节点
{
infoin row;
struct nodein *next;
} nodein;
typedef struct infoout//主链信息
{
nodein *headin;//子链头节点
char *word;//主链自身信息
} infoout;
typedef struct nodeout//主链节点
{
infoout word;
struct nodeout *next;
} nodeout;
int Initout(nodeout *headout)//主链初始化
{
if (headout == NULL)
{
printf("malloc fail in main for headout\n");
return fail;
}
headout->next = NULL;
return success;
}
int lengthout(nodeout *headout)//返回主链长度
{
int len = 0;
nodeout *p = headout;
while (p != NULL)//一直算到尾节点结束
{
len+&#