1.创建一个队列时,空队列中队首和队尾相同,但不是NULL,队首后面挂的元素才是NULL 2.打印队列时,对于链队列,不能把指针加一来找到下一个数据,因为链表地址不连续,需要复制一条链表,不断往后遍历来挨个打印链表的数据 3.求队伍的长度也是,不能首尾指针相减,因为地址不连续,所以同样需要复制一条链 ...
分类:
编程语言 时间:
2020-07-19 18:05:49
阅读次数:
71
在开始之前,首先要说明这几点: 1.在Python中,通常有这几种方式来表示时间:1)时间戳 2)格式化的时间字符串 3)元组(struct_time)共九个元素。由于Python的time模块实现主要调用C库,所以各个平台可能有所不同。2.UTC(Coordinated Universal Tim ...
分类:
编程语言 时间:
2020-07-19 17:47:28
阅读次数:
93
渔民的烦恼 题目描述 在某个海边小国,大多数居民都是渔民,这个国家的所有城镇都沿直线分布在海边。渔民们捕获大量的海鱼,但就象世界上大多数的渔民一样,他们并不喜欢吃鱼,所以他们决定从邻国收养一些贫困家庭的小孩,让他们来帮着吃鱼,国家规定每个城镇收养的贫困儿童数量必须相等。 一条又长又直的公路贯穿整个海 ...
分类:
其他好文 时间:
2020-07-19 17:45:46
阅读次数:
117
太久没学OI了, 代码都不会写了, 先写一篇BFS练练手, 是我太菜了qwq #include<cstdio> #include<queue> #include<iostream> #include<cstring> using namespace std; struct node{ int x,y ...
分类:
其他好文 时间:
2020-07-19 16:30:54
阅读次数:
69
链接:https://leetcode-cn.com/problems/recover-binary-search-tree/ 代码 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode ...
分类:
其他好文 时间:
2020-07-19 11:36:41
阅读次数:
70
链接:https://leetcode-cn.com/problems/same-tree/ 代码 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode ...
分类:
其他好文 时间:
2020-07-19 11:33:58
阅读次数:
44
记住一件事情即可:Trie是高效存储和查找字符串集合的数据结构 一般来说题目是会限制字母的种类,不会太多 #include <iostream> #include <cstring> #include <string> #include <cmath> #include <cstdio> #incl ...
跑ac自动机后使用fail树建立dfs序后跑树状数组维护答案 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=1e6+10; struct node{ int cnt; node * nxt ...
分类:
其他好文 时间:
2020-07-19 00:37:01
阅读次数:
84
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=3e5+100; const int mod=998244353; ll fpow (int x,int y) { ll ans=1; ...
分类:
其他好文 时间:
2020-07-18 22:52:12
阅读次数:
105
一、基本架构Javascript的绑定方法和lua的绑定方法有些不同,主要原因是javascript的引擎有很多种,比如嵌入式系统常用的jerryscript和PC上常用的V8。不同的引擎提供注册C/C++函数的能力不同,所以在绑定时我们只对引擎做一个最低能力的要求:提供注册全局函数的能力。 我们把 ...
分类:
编程语言 时间:
2020-07-18 22:37:30
阅读次数:
84