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 阅读全文
摘要:
#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 阅读全文
摘要:
//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 *_... 阅读全文
|
Copyright © 2024 qingcheng奕
Powered by .NET 8.0 on Kubernetes |