![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
Jacklucicc
这个作者很懒,什么都没留下…
展开
-
RR调度算法_简单的一笔
class RR(): def __init__(self,timeSlice=10): self.timeSlice=timeSlice self.runTimes=[25,37,12,46,29,5,18] self.peintf() def peintf(self): self.new=[] # print((max(self.runTimes) // self.timeSlice) + 1)原创 2020-11-22 15:40:23 · 1572 阅读 · 0 评论 -
Code is far away from bug with the animal protecting
/* * ┏┓ ┏┓+ + * ┏━┛┻━━━━━━┛┻━┓ + + * ┃ ┃ + + + * ┃ ━ ┃ + + + + * ┃ ████━████ ┃ * ┃ ┃ + + * ┃ ...转载 2019-11-11 21:10:35 · 324 阅读 · 0 评论 -
第6章 善于使用指针与引用
#include<iostream>using namespace std;void test0010()//用指针访问一维数组{//注:一维数组用一重循环实现访问各个元素 int a[10]; int i, * p = a; cout << "请输入10个数保存到a数组中:"; for (i = 0; i < 10; i++) cin >&g...原创 2019-11-10 14:41:25 · 153 阅读 · 0 评论 -
单链表//返回地址
#include<iostream>using namespace std;typedef struct lnode{ int data; lnode* next;}lnode, * linklist;void creatlist_r(linklist& l, int n)//尾插法{ l = new lnode; l->next = NULL; l...原创 2019-11-10 11:55:37 · 698 阅读 · 0 评论 -
单链表//插入删除
#include<iostream>using namespace std;typedef struct lnode{ int data; lnode* next;}lnode, * linklist;void creatlist_r(linklist& l, int n)//尾插法{ l = new lnode; l->next = NULL; l...原创 2019-11-10 11:36:21 · 64 阅读 · 0 评论 -
单链表//插入
#include<iostream>using namespace std;typedef struct lnode{ int data; lnode* next;}lnode, * linklist;void creatlist_r(linklist& l, int n)//尾插法{ l = new lnode; l->next = NULL; l...原创 2019-11-10 10:39:34 · 92 阅读 · 0 评论 -
单链表//elemtype为结构体形式输入
#include<iostream>using namespace std;typedef struct{ string name; int year;}elemtype;typedef struct lnode{ elemtype data; lnode* next;}*linklist;elemtype haha[10];int creatlist_r(l...原创 2019-11-10 10:20:38 · 1058 阅读 · 0 评论 -
链式队列
链式队列没有队满情况,可以添加任意个结点,操作特点:尾插头删#include <stdio.h>#include <stdlib.h>#define ERROR 0#define OK 1 typedef struct node{ int data; struct node *next;}Node; typedef struct queue{...转载 2019-11-09 13:07:53 · 161 阅读 · 0 评论 -
循环队列//输入输出
#include<iostream>using namespace std;#define maxsize 3 //有用?typedef struct{ int data[maxsize]; //注意 int* data; int front; int rear;}squeue;void init(squeue& q){ q.front = ...转载 2019-11-09 12:54:05 · 1645 阅读 · 0 评论 -
尾递归与递归
function f(n) { if (n === 1) { return 1 } return n * f(n - 1)}f(3) // 6//尾递归function f(x) { return g(x);} function f(x) { if (x > 0) { return m(x) } return n(x);} /...转载 2019-11-09 12:17:05 · 75 阅读 · 0 评论 -
分治法求解递归问题算法的一般形式
void p(参数表){ if (递归结束条件) 可直接求解步骤; //基本项 else p(较小的参数); //归纳项}long Fact(long n){ if (n == 0) return 1; //基本项 else return n*Fact(n - 1); ...原创 2019-11-09 12:07:07 · 219 阅读 · 0 评论 -
链栈//输入输出
#include<iostream>using namespace std;#define SElemType int /*1.链表的头指针就是栈顶。2.不要头结点。3..基本不存在栈满的情况。4.空栈相当于头指针指向空。5.插入和删除仅在栈顶处执行。*/typedef struct stacknode{ SElemType data; stacknode* n...原创 2019-11-09 12:07:29 · 1391 阅读 · 0 评论 -
顺序栈//输入输出
#include <iostream>#include <stdio.h>#include <malloc.h>using namespace std;#define OK 1#define ERROR 0#define OVERFLOW -2#define MAXSIZE 100#define exittypedef char ElemT...原创 2019-11-09 12:07:39 · 2605 阅读 · 0 评论 -
顺序栈//代码
#include <iostream>#include <stdio.h>#include <malloc.h>using namespace std;#define OK 1#define ERROR 0#define OVERFLOW -2#define MAXSIZE 100#define exittypedef char ElemT...原创 2019-11-09 12:07:57 · 723 阅读 · 0 评论 -
单链表//头插法*尾插法
#include<iostream>using namespace std;typedef struct lnode{ int data; lnode* next;}lnode,*linklist;void creatlist_h(linklist& l, int n)//头插法{ l = new lnode; l->next = NULL; for...原创 2019-11-09 12:05:04 · 124 阅读 · 0 评论 -
单链表头插法练习
*#includeusing namespace std;typedef struct lnode{int data;struct lnode next;}lnode,*linklist;void initlist(linklist& l){l = new lnode;l ->next = NULL;}void creat(linklist& l,in...原创 2019-11-09 12:08:25 · 141 阅读 · 0 评论