ITfeng

 

2012年4月18日

数据结构-栈实现(数组和队列)

摘要: 链表实现栈#include<stdio.h>#include<stdlib.h>typedef struct list{int data;struct list *next;}List;typedef struct stack{List*top;}Stack;void init_stack(Stack*s){s->top=NULL;}void push_stack(Stack *s,int data){List *newnode=(List*)malloc(sizeof(List));newnode->data=data;newnode->next=s 阅读全文

posted @ 2012-04-18 21:24 ITfeng 阅读(204) 评论(0) 推荐(0) 编辑

导航