画画还真是费时间,主要的思路就是有队列来完成层次遍历,首先需要一个遍历结点的指针p,初始化首尾指针,当p!=null进入循环,让根节点1入队,rear指针+1, 下面的循环遍历条件是首尾指针不等(rear!=front) 标记一下此时的父结点p就是队列的首结点p=queue[rear],首节点出队f ...
分类:
编程语言 时间:
2020-06-04 21:17:21
阅读次数:
83
MQ全称Message Queue ,即消息列队,RabbitMQ是由erlang语言开发,基于AMQP(Advanced Message Queue 高级消息列队协议) 协议实现的消息列队,它是一中应用程序之间的通信方法,消息队列在分布式系统开发中应用非常广泛。官网:https://www.rab ...
分类:
其他好文 时间:
2020-06-04 15:41:42
阅读次数:
66
ArrayDeque双端队列 使用&实现原理分析 学习Okhttp实现源码时,发现其任务分发时用到了ArrayDeque。因此了解一下ArrayDeque的使用方式和实现原理。 一、Deque deque(double-ended queue)双端队列,是一种具有队列和栈的性质的数据结构。 双端队列 ...
分类:
其他好文 时间:
2020-06-04 15:22:34
阅读次数:
47
#include<cstdio> #include<queue> #include<cstring> #include<cmath> #include<iostream> #define mod 9987 using namespace std; const int N=1000005; int e ...
分类:
其他好文 时间:
2020-06-04 09:12:20
阅读次数:
66
#include <stdio.h> #include <stdbool.h> #include <stdlib.h> //exit 函数需要 #include <malloc.h> #define MAXSIZE 8 typedef struct queue { int* arr; //int 类 ...
分类:
其他好文 时间:
2020-06-04 01:42:21
阅读次数:
70
#include<map> #include<queue> #include<time.h> #include<limits.h> #include<cmath> #include<ostream> #include<iterator> #include<set> #include<stack> # ...
分类:
Web程序 时间:
2020-06-04 01:22:05
阅读次数:
66
#include<iostream> #include<cstdio> #include<algorithm> #include<queue> #include<iomanip> #include<cstring> using namespace std; typedef long long ll; ...
分类:
其他好文 时间:
2020-06-04 01:12:55
阅读次数:
61
package LeetCode_50 /** * 50. Pow(x, n) * https://leetcode.com/problems/powx-n/description/ * * Implement pow(x, n), which calculates x raised to the ...
分类:
其他好文 时间:
2020-06-04 01:10:44
阅读次数:
68
一、双端队列 双端队列 双端队列(deque,全名double-ended queue),是一种具有队列和栈的性质的数据结构。 双端队列中的元素可以从两端弹出,其限定插入和删除操作在表的两端进行。双端队列可以在队列任意一端入队和出队。 双端队列(Deque),是一种类似于队列的元素的有序集合。它拥有 ...
分类:
编程语言 时间:
2020-06-03 21:56:36
阅读次数:
104
每年都有大批的应届生步入社会, 也有大批的程序员跳槽, 尤其是三四月, 九十月. 金三银四, 金九银十. 跳槽找工作面试是必须的. 面试时有时候会遇到各种各样的问题, 也许还会有各种各样的奇葩问题. 我面试的时候, 去之前会把中意的公司网上查查, 去面试的时候会带个小本本, 一支笔去. 等面试出来时 ...
分类:
其他好文 时间:
2020-06-03 18:54:44
阅读次数:
44