队列 介绍 队列是一个有序列表,可以用 数组 或者 链表 实现 遵循先进先出原则 数组模拟队列 队列本身是有序列表,maxSize为队列最大容量 需要两个 front , rear 随着数据输入而改变 rear是队尾,front为队头 队列入队为addQueue, addQueue处理 1. 尾指针 ...
分类:
其他好文 时间:
2020-02-20 12:57:35
阅读次数:
61
1.数组实现的栈 #include <stdio.h> #include <string.h> #include <stdlib.h> #define MAXSIZE 5 /** *数组实现的栈,缺点,容量固定 **/ typedef struct{ int data[MAXSIZE]; int i ...
分类:
编程语言 时间:
2020-02-16 14:58:55
阅读次数:
102
有三种不同的用法 class queue.Queue(maxsize=0) #队列:先进先出 按 Ctrl+C 复制代码 按 Ctrl+C 复制代码 class queue.LifoQueue(maxsize=0) #堆栈:last in fisrt out import queue q=queue ...
分类:
编程语言 时间:
2020-02-11 21:58:36
阅读次数:
90
//顺序表结构体定义 #define maxsize 100 typedef struct { int date[maxsize];//存放顺序表元素的数组 int length;//存放顺序表长度 } sqlist;//sqlist 是别名. //插入算法的思路 //如果插入位置不合理,抛出异常 ...
分类:
其他好文 时间:
2020-02-11 00:24:44
阅读次数:
66
Heap分为MaxHeap和MinHeap Heap均为完全二叉树 定义heap的结构 typedef struct{ int *Elements; //储存堆元素数据,假设储存数组 int Size; //堆当前元素个数 int MaxSize; //堆最大容量 }heap; 初始化heap的操作 ...
分类:
其他好文 时间:
2020-02-08 10:11:52
阅读次数:
94
一.Fetch抓取 Fetch抓取是指,Hive 中对某些情况的查询可以不必使用MapReduce计算。 在 hive-default.xml.template 文件中 hive.fetch.task.conversion 默认是 more,老版本 hive默认是 minimal,该属性修改为 mo ...
分类:
其他好文 时间:
2020-01-28 23:21:26
阅读次数:
87
1,对数组模拟队列的优化,充分利用数组,因此将数组看做是一个环形的(通过取模的方式来实现) 2,分析说明: ①尾索引的下一个为头索引时表示队列满,即将队列容量空出一个作为约定,这个在做判断队列满的时候需要注意 (rear+1) % maxSize == front 满 ②rear == front ...
分类:
编程语言 时间:
2020-01-28 23:15:25
阅读次数:
129
$ composer config repos.packagist composer https://php.cnpkg.org$ composer config cache-files-maxsize 2048MiB Link:https://www.cnblogs.com/farwish/p/1 ...
分类:
Web程序 时间:
2020-01-25 23:26:27
阅读次数:
102
1 #include <stdio.h> 2 #include <stdlib.h> 3 4 #define OK 1 5 #define ERR 2 6 #define TRUE 1 7 #define FALSE 0 8 #define MAXSIZE 4 //定义队列的最大长度 9 10 ty ...
分类:
编程语言 时间:
2020-01-23 18:21:49
阅读次数:
157
1 queue 模块 分类(共同点if maxsize <=0 队列长度没有限制.) queue.Queue(maxsize =0) First in first OUT(FIFO) queue.LifoQueue(maxsize=0) 后进先出(Last In First Out: LIFO)队列 ...
分类:
编程语言 时间:
2020-01-22 23:56:13
阅读次数:
150