- 博客(10)
- 收藏
- 关注
原创 顺序表整体删除某值或某一区间
时间复杂度都为o(n)#include#include#define maxn 111111typedef struct{ int a[maxn]; int len;}sequence_list;void dele(sequence_list *L,int min,int max) //删除顺序表中大于等于min,小于max,的数,时间复杂度o(n){
2015-09-30 13:58:46 649
原创 链式队列
//基本与单链表相同,链式队列主要为头部删除,尾部插入,另外多了总指针指向队列的头和尾#include#includetypedef int datatype;typedef struct link_queue{ datatype info; struct link_queue *next;}node;typedef struct{ node *front
2015-09-30 13:37:33 329
原创 链式栈
//链式栈就是顺序表的一种特殊情况,可以看成从从头结点进行插入删除操作#include#includetypedef int datatype;typedef struct link_stack{ datatype info; struct link_stack *next;}node;node *init(){ return NULL;}node *cre
2015-09-29 13:24:10 288
原创 将循环链表插在单链表头部
#include#includetypedef struct link_list{ int info; struct link_list *next;}node;node *init(){ return NULL;}node *create_headlink() //创建循环链表{ int x; node *head=(node *)ma
2015-09-28 00:47:57 266
原创 简单的c#操作
private void button1_Click(object sender, EventArgs e) { this.Text = "这是一个应用程序"; this.BackColor = Color.FromArgb(200, 22, 0); this.label1.SetBounds(10, 50, 20, 100); }鼠标
2015-09-26 22:14:38 294
原创 链表合集
单链表#include#includetypedef int datekey;typedef struct link_node{ datekey info; struct link_node *next;}node;node *init(){ return NULL;}void display(node *head)//输出各个节点的值{ n
2015-09-18 11:39:35 393
原创 火车进站问题
#include#include#include#define maxn 1111/*比当前数要小且在在他后面的数若从大到小排列则符合要求*/int n,count;int ans[maxn],vis[maxn],num[maxn];void print();//用来输出全排列中符合要求的个数void dfs(int k,int cnt) //深搜枚举1-n的全排列,k为数组下标
2015-09-17 10:49:47 539
原创 排列组合
dfs枚举n个数中长度为m的全排列#include#include#include#define maxn 111using namespace std;int n,m,sum;int ans[maxn];bool vis[maxn];int num[maxn];void dfs(int k,int cnt){ if(cnt==m) { fo
2015-09-17 09:48:31 283
原创 栈的应用
//括号匹配#include#include#include#define MAXSIZE 100typedef int datatype;typedef struct{ datatype a[MAXSIZE]; int top;}sequence_stack;void init(sequence_stack *st){ st->top=0; } datatype
2015-09-16 23:31:32 387
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人