qingcheng奕  

2013年5月25日

摘要: //随机生成100个数,做插入排序,链表的练习随机生成100个数,做插入排序,链表的练习#include <iostream>#include <stdio.h>#include <stdlib.h>typedef struct node{ int data; struct node* next;};void insert(node * tnode,node* thead){ node *itr = thead; if(tnode->data <thead->data) { tnode->next = thead; thead = t 阅读全文
posted @ 2013-05-25 17:08 qingcheng奕 阅读(160) 评论(1) 推荐(0) 编辑
 
摘要: #include <iostream>const int SIZE = 101;typedef struct queue{ int front,rear; int data[SIZE];};void init(struct queue *_queue){ _queue->front = _queue->rear = 0;}bool isEmpty(struct queue *_queue){ return _queue->front ==_queue->rear;}bool isFull(struct queue *_queue){ return _queu 阅读全文
posted @ 2013-05-25 17:05 qingcheng奕 阅读(91) 评论(0) 推荐(0) 编辑
 
摘要: //zhan和队列,你就实现一个之后,插入1-100,然后取出1-100#include <iostream> typedef int datatype;#define SIZE 100typedef struct stack{ datatype data[100]; int head;}_stack;void init(struct stack *_stack){ for(int i = 0;i<100;i++) (*_stack).data[i] = 0; (*_stack).head = 0;}bool isEmpty(struct stack *_... 阅读全文
posted @ 2013-05-25 17:04 qingcheng奕 阅读(107) 评论(0) 推荐(0) 编辑