首页 > 代码库 > 【数据结构】链式存储单链表

【数据结构】链式存储单链表


数据结构单链表的链式存储实现


//======================================================================  
//  
//        Copyright (C) 2014-2015 SCOTT      
//        All rights reserved  
//  
//        filename: List.c
//        description: a demo to display SeqList
//  
//        created by SCOTT at  01/28/2015 
//        http://blog.csdn.net/scottly1
//  
//======================================================================  

#include <stdio.h>
#include <string.h>
#include <malloc.h>

#define TRUE	1
#define FALSE	1

typedef int Status;
typedef int ElementType;

typedef struct _tag_Node
{
	ElementType data;
	struct _tag_Node *next;
}NODE, *PNODE;


PNODE initList()
{
	int i, j = 0;
	int nLen;
	PNODE pHead = NULL;
	PNODE pNode = NULL;	

	printf("Input The Length:");
	scanf("%d", &nLen);

	pHead = (PNODE)malloc(sizeof(NODE));
	pHead->data = http://www.mamicode.com/nLen;                      // 头结点数据域可用于存储如链表长度等信息。>

注:原创文章,转载请注明出处:http://blog.csdn.net/scottly1/article/details/43247465


【数据结构】链式存储单链表