自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(23)
  • 收藏
  • 关注

原创 红黑树总结

红黑树:30张图带你彻底理解红黑树 - 简书 (jianshu.com) 性质1:每个节点要么是黑色,要么是红色。 性质2:根节点是黑色。 性质3:每个叶子节点(NIL)是黑色。NIL为空的叶子节点 性质4:每个红色结点的两个子结点一定都是黑色。 性质5:任意一结点到每个叶子结点的路径都包含数量相同的黑结点。 左旋:以某个结点作为支点(旋转结点),其右子结点变为旋转结点的父结点,右子结点的左子结点变为旋转结点的右子结点,左子结点保持不变。 右旋:以某个结点作为支点(旋转结点),其左子结点变为旋转

2021-06-07 23:20:24 153 3

原创 算法-全排列

全排列 从n个不同元素中任取m(m≤n)个元素,按照一定的顺序排列起来,叫做从n个不同元素中取出m个元素的一个排列。当m=n时所有的排列情况叫全排列 #include <iostream> using namespace std; int a[3] = {1, 2, 3}; int visit[3] = {0}; int path[3] = {0}; int count = 0; void dfs(int index) { if (count >= 3) {

2021-05-22 23:07:48 103

原创 SpringAOP的cglib,dynamic总结

cglibdynamic怎么用? 代理对象实现了接口,默认dynamic 代理对象实现了接口,可强制cglib 代理对象是单纯类没实现接口,只能用cglib 原因:dynamicProxy的生产代理增强类的**Proxy.newProxyInstance.(ClassLoaderloader, Class<?>[]interfaces, InvocationHandlerh)**代理对象需要是接口类型 ...

2021-03-04 23:15:18 135 1

原创 SpringBoot传文件的踩坑

错误:the request was rejected because no multipart boundary was found 在request header 加上 Content-Type :multipart/form-data;boundary=1111 随机数字都可以

2020-09-17 21:28:11 254

原创 MYSQL的SQL优化,多表连接后有order by排序,出现Using temporary; Using filesort情况

使用EXPLIAN字段可以对sql语句进行分析,当extra有Using temporary; Using filesort等时表示需要进行优化,意思分别是用了临时表和一种sql的排序。 eg1: select * from a inner join b where a.id=b.aid order by a.id;这种情况下: 如果a的集合比b小,那么mysql就会以a为驱动表,这个时候如...

2019-07-10 22:48:11 7587 2

原创 springBoot传list类型的注意

list = JSON.stringify(list); // layer.msg(JSON.stringify(list)) layer.confirm('确认要删除吗?' , function(index) { //捉到所有被选中的,发异步进行删除 $.ajax({ ...

2019-04-13 19:46:09 5641

原创 OJ kruskal算法求最小生成树

总时间限制: 10000ms单个测试点时间限制: 1000ms内存限制: 65536kB描述要求对一个图使用kruskal算法求最小生成树,依次输出选出的边所关联的顶点序列,要求下标较小者在前,如图所示,其顶点序列为1 3 4 6 2 5 3 6 2 3输入若干行整数第一行为两个整数,分别为图的顶点数和边数第二行开始是该图的邻接矩阵,主对角线统一用0表示,无直接路径的两点用100来表示(保证各边权...

2018-04-13 17:30:50 1272 3

原创 OJ 赫夫曼编码

描述先从键盘输入若干电文所用符号及其出现的频率,然后构造赫夫曼树,从而输出赫夫曼编码。注意:为了保证得到唯一的赫夫曼树,这里规定在构造赫夫曼树时,左孩子结点权值不大于右孩子结点权值,如若有多种选择,则尽量先选序号偏小的结点。编码时,左分支取“0”,右分支取“1”输入3行第1行:符号个数n(2~20);第2行:符号,用空格分隔;第3行:各符号出现频率(用乘以100后的整数),用空格分隔;输出各符号对...

2018-04-13 12:59:35 1165

原创 PAT 甲级 1011. World Cup Betting (20)

#include &lt;iostream&gt; #include "cstring" #include &lt;stdio.h&gt; #include "iomanip" #include "vector" #include "cmath" #include "stack" #include "algorithm" #include &lt;m

2018-03-20 17:15:31 126

原创 OJ 4127:迷宫问题 递归输出路径

描述定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, };它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。输入一个5 × 5的二维数组,表示一个迷宫。数...

2018-03-18 18:13:14 563

原创 OJ 3752:走迷宫 bfs

总时间限制: 1000ms内存限制: 65536kB描述一个迷宫由R行C列格子组成,有的格子里有障碍物,不能走;有的格子是空地,可以走。给定一个迷宫,求从左上角走到右下角最少需要走多少步(数据保证一定能走到)。只能在水平方向或垂直方向走,不能斜着走。输入第一行是两个整数,R和C,代表迷宫的长和宽。( 1&lt;= R,C &lt;= 40)接下来是R行,每行C个字符,代表整个迷宫。空地格子用'.'...

2018-03-18 17:32:52 396

原创 六度空间 (bfs,广度优先)

7-9 六度空间(30 分)“六度空间”理论又称作“六度分隔(Six Degrees of Separation)”理论。这个理论可以通俗地阐述为:“你和任何一个陌生人之间所间隔的人不会超过六个,也就是说,最多通过五个人你就能够认识任何一个陌生人。”如图1所示。图1 六度空间示意图“六度空间”理论虽然得到广泛的认同,并且正在得到越来越多的应用。但是数十年来,试图验证这个理论始终是许多社会学家努力追...

2018-03-17 17:57:08 943

原创 openjudge 拦截导弹 (DP 动态规划)

样例输入8 389 207 155 300 299 170 158 65样例输出6当整个数组位递增序列时候输出1,所以用来记录最大值maxx=1,不然会输出0,卡在这里好久,dp写的没错,但是ac不了,后来对比别人的代码,发现问题,还有一个注意点,a[i]&gt;=a[j](i&lt;j) ,因为是不递增序列,等于情况符合#include &lt;iostream&gt; #include "cs...

2018-03-15 17:24:22 300

原创 openjudge 最大子矩阵 (DP 动态规划)

#include &lt;iostream&gt; #include "cstring" #include &lt;stdio.h&gt; #include "iomanip" #include "vector" #include "cmath" #include "stack" #include "algorithm" #include &lt;m

2018-03-15 16:02:21 229

原创 PAT 甲级 1009. Product of Polynomials (Map)

This time, you are supposed to find A*B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the information...

2018-03-12 16:41:42 164

原创 PAT 甲级 1007. Maximum Subsequence Sum (DP 动态规划)

部分正确#include &lt;iostream&gt; #include "cstring" #include &lt;stdio.h&gt; #include "iomanip" #include "vector" #include "cmath" #include "stack" #include "algorithm" #include &

2018-02-20 17:52:27 194

原创 PAT 甲级 1008. Elevator

#include &lt;iostream&gt; #include "cstring" #include &lt;stdio.h&gt; #include "iomanip" #include "vector" #include "cmath" #include "stack" #include "algorithm" #include &lt;m

2018-02-20 17:49:43 111

原创 PAT 甲级 1006. Sign In and Sign Out

测试用例Sample Input:3 CS301111 15:30:28 17:00:10 SC3021234 08:00:00 11:25:25 CS301133 21:45:00 21:58:40 Sample Output:SC3021234 CS301133输出最早的人和最晚的人#include &lt;iostream&gt; #include "cstring" #include &l...

2018-02-13 18:55:52 219

原创 PAT 甲级 1005. Spell It Right (递归)

Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input file contains one test case. Each ca...

2018-02-12 18:33:01 196

原创 PAT 甲级 1003. Emergency 使用 优先队列 dijkstra 算法

As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the l...

2018-02-12 14:27:52 242

原创 PAT 甲级 1004. Counting Leaves 使用深度遍历(DFS)

A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.InputEach input file contains one test case. Each case starts with a line contai...

2018-02-12 14:05:40 197

原创 PAT 甲级 1002 A+B for Polynomials

This time, you are supposed to find A+B where A and B are two polynomials.InputEach input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomia...

2018-02-11 19:01:33 126

原创 PAT 甲级 1001 A+B Format

开两个数组,一个存数字,一个存逗号,一开始用递归快点写了,发现逗号不好处理改用2个数组做了#include &lt;iostream&gt; #include "cstring" #include &lt;stdio.h&gt; #include "iomanip" #include "vector" #include "cmath" #include "stack" #inc

2018-02-11 18:37:09 139

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除