- 博客(129)
- 资源 (2)
- 收藏
- 关注
原创 关于已知二叉树的先序中序推出后序,或者后序中序推出先序遍历
/**根据中序遍历 先序遍历构建 输出后序遍历后序遍历为左右根 递归的返回条件中序遍历中 左子树和右子树1. 过i将中序遍历中的树分为左子树和右子树 (i为中序遍历的根节点(需要输出的结点(每棵树都是自己的根结点))2.确定左子树的start,与 end范围,同时通过先序数组找到此时的根节点(上一个根结点+1)3.确定右子树的start,与 end范围, /...
2019-06-06 19:12:29 271
原创 dijkstra总结:
此题属于dijkstra双边权问题,直接使用dijkstra算法找到满足题意条件的边长1. 对于边权问题的处理方法: 设定w[ k ] = weight[ u ][k] + w[u]; //求出满足题意要求的边权值2. 对于点权问题的处理方法: w[ k ] = weight[k]+ w[ u ] //求出满足题意要求点权值...
2019-06-04 11:07:33 246
原创 hdu 2795 Billboard(线段树单点最大值更新)
/*本题的题意: 给定一个广告栏, 高为h 宽为 w 现在给出k个高为1 宽度为l的告示告示只能从最高处以及最左边开始粘贴, 现在需要求出每张告示在广告栏第几行进行粘贴。(最高处为第一行)本题思路: 暴力超时的思想, 设定一个一维数组,长度为h ,里面的值为w, 每输入一个l,就从左到右扫描一次 代码,观察数组的容量是否足够 容纳具体的值 本题可以利用线段树思想, ...
2019-12-02 22:26:17 259
原创 hdu 1698 Just a Hook(线段树区间更新)
http://acm.hdu.edu.cn/showproblem.php?pid=1698/*本题题意 给定 t 组测试用例, 每组测试用例给定长度为n 的分数, 每个分数的初始值为1, 给定m组查询方法 查询方法 包括更新一个区间的分数为 1(铜钩子的分数), 或者 2(银钩子的分数) 或者 3(金钩子的分数), 最后需要输出整个 区间的值本题思...
2019-12-02 21:32:34 205
原创 hdu 1394 Minimum Inversion Number(线段树,数学)
http://acm.hdu.edu.cn/showproblem.php?pid=1394/*本题题意就是: 给定多组测试用例 给定一个长度n的数组, 该数组包含的值为 0 - n - 1 , 现在如果每次都要将数组最左边的一位值拼接到 最右边,直到回到原数组, 现在需要求出 所有置换的 最小的逆序对本题思路: 首先需要直到什么是逆序对: ...
2019-11-28 12:46:42 213
原创 I Hate It(线段树模板)
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1754 线段树模板题本题题意: 有多组测试数据, 给定长度为n的小组, 并且给定m个查询条件, 查询条件有 给定 c a b 1.如果c 为Q 表示 查找在a, b区间内最大的人数,2.如果c为 U 更新区间 a小组的值为b本题思路: 一道线段树模板题目, ...
2019-11-26 21:12:02 175
原创 idea打开html静态页面显示404错误
出现该错误的原因是 项目文件夹名字与项目名字不同导致请求url时 出现了 /项目文件夹名/项目名 导致无法找到指定的url资源地址解决方法更改项目名字为文件夹名 或者更改文件夹名字为项目名字:(在idea中右键点击项目名字refactor即可更改项目名)...
2019-11-04 14:30:09 10478 10
原创 客户端连接阿里云数据库记录
客户端连接阿里云服务器(unbantu16.04)mysql数据库记录1. 卸载mysql1.1 首先卸载所有的mysqlsudo apt-get remove mysql-*2.2 然后清理残留文件dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P2. 安装mysql2.1 更新源apt-get update2....
2019-11-03 11:24:16 550
转载 c++中stringStream方法的使用
https://blog.csdn.net/xw20084898/article/details/21939811
2019-08-31 19:00:33 125
原创 java idea常用快捷键
一键格式化代码:ctrl + alt + L回到上一步 ctrl + alt + <-回到下一步 ctrl + alt + ->
2019-08-24 09:20:05 165
原创 1121 Damn Single(简单模拟)
1121 Damn Single (25 分)"Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be taken care of.Input ...
2019-08-21 11:00:54 292
原创 1116 Come on! Let's C(简单模拟)
1116 Come on! Let's C (20 分)"Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun...
2019-08-21 09:19:21 158
原创 1113 Integer Set Partition(小模拟)(简单逻辑)
1113 Integer Set Partition (25 分)Given a set of N (>1) positive integers, you are supposed to partition them into two disjoint sets A1 and A2 of n1 and n2 numbers, respectively. Let S...
2019-08-19 16:20:38 136
原创 1145 Hashing - Average Search Time (hash平方探测法)
1145 Hashing - Average Search Time (25 分)The task of this problem is simple: insert a sequence of distinct positive integers into a hash table first. Then try to find another sequence of integer key...
2019-08-17 15:48:38 232
转载 java环境配置
java环境配置:https://blog.csdn.net/csdn_0911/article/details/83010321javac生成字节码文件(就是.class文件): , java运行字节码文件https://blog.csdn.net/peng86788/article/details/81296882 ...
2019-08-13 20:13:14 96
原创 1144 The Missing Number(set的运用)(简单模拟)
1144 The Missing Number (20 分)Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list.Input Specification:Each input file contains one test case. F...
2019-08-13 16:10:35 123
原创 1090 Highest Price in Supply Chain 1106 Lowest Price in Supply Chain(dfs树的遍历)
1106 Lowest Price in Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Start...
2019-08-13 15:33:45 131
原创 1086 Tree Traversals Again(中序 先序栈 构建 后序二叉树)
1086 Tree Traversals Again (25 分)An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered ...
2019-08-12 19:29:32 170
原创 1089 Insert or Merge (25 分) (判断插入排序,分治排序)
1089 Insert or Merge (25 分)According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one...
2019-08-09 14:16:56 183
原创 1045 Favorite Color Stripe
1045 Favorite Color Stripe (30 分)Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off those unwanted pi...
2019-08-08 22:52:26 189
原创 1049 Counting Ones(数学逻辑)(化简)
1049 Counting Ones (30 分)The task is simple: given any positive integer N, you are supposed to count the total number of 1's in the decimal form of the integers from 1 to N. For example, given N bei...
2019-08-06 22:29:16 168
原创 leetCode动态规划(java):
题目转载自: https://leetcode-cn.com/problems/unique-paths/ 官方网站322. Coin ChangeYou are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest ...
2019-08-06 14:13:21 239
原创 pat甲级1101 Quick Sort(左右数组)(简单模拟)
1101 Quick Sort (25 分)There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then the elements less than the p...
2019-08-03 12:21:36 137
原创 pat甲级 1093 Count PAT's (左右数组处理)(简单模拟)
1093 Count PAT's (25 分)The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and ...
2019-08-03 11:56:51 204
原创 1153 Decode Registration Card of PAT (25 分)(排序题)(字符串的处理)
1153 Decode Registration Card of PAT (25 分)A registration card number of PAT consists of 4 parts:the 1st letter represents the test level, namely, T for the top level, A for advance and B for basi...
2019-07-24 15:23:23 150
原创 c++中stl map的使用
map<string, int> m; // 定义⼀个空的map m,键是string类型的,值是int类型的unordered_map<string, int> 效率更高, // ⽤迭代器遍历,输出map中所有的元素,键⽤it->first获取,值⽤it->second获取for (auto it = m.begin(); it != m.end...
2019-07-24 15:20:23 141
原创 1073 Scientific Notation(简单模拟)(字符串的处理)
Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9].[0-9]+E[+-][0-9]+ which means that the inte...
2019-07-19 16:39:16 130
原创 1077 Kuchiguse(简单模拟)(字符串处理)
1077 Kuchiguse (20 分)The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker's personality. Such ...
2019-07-19 09:07:44 187
转载 springboot @PathVariable的用法
https://blog.csdn.net/ckc_666/article/details/79239974
2019-07-17 12:53:02 1063
转载 springboot @ConditionalOnProperty 的作用
转载自:https://blog.csdn.net/dalangzhonghangxing/article/details/78420057spring boot中有个注解@ConditionalOnProperty,这个注解能够控制某个configuration是否生效。具体操作是通过其两个属性name以及havingValue来实现的,其中name用来从application.pr...
2019-07-17 12:48:38 310
原创 关于docker上部署 mlnio 云文件管理系统
官方文档地址:https://docs.min.io/docs/minio-client-quickstart-guide.html在服务器docker上首先下拉镜像文件:sudo docker pull mlnoi下拉镜像后, 此时需要创建容器, 根据官方文档描述 创建镜像 -p :内部端口 :外部端口 (都设置为9000)acess_key :连接keysecr...
2019-07-16 17:06:40 362
转载 关于git上传使用总结
1.将本地代码上传到远程仓库:https://blog.csdn.net/yl_cc/article/details/726765382.git emote origin already exists错误的解决办法https://www.jianshu.com/p/3380ec281729、先输入 git remote rm origin2、再输入 git rem...
2019-07-12 15:58:19 130
原创 关于doker jdk部署记录:
sudodockerpulldocker.io/mysql:5.7.9 //这条命名是下拉mysql 5.7.9的命令 加上了io 使得下拉镜像加快https://blog.csdn.net/O1_1O/article/details/52710733关于docker 中容器 打开瞬间关闭的解决办法 .创建容器时添加 -dit命令关于docker 安装jdk容器文档...
2019-07-11 12:40:02 157
原创 pat甲级1067 Sort with Swap(0, i)(贪心)
1067 Sort with Swap(0, i) (25 分)Given any permutation of the numbers {0, 1, 2,..., N−1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation that is allowed to ...
2019-07-08 23:45:53 155
原创 1070 Mooncake(贪心算法(求最高单价))
1070 Mooncake (25 分)Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the ...
2019-07-07 10:50:03 219
原创 1055 The World's Richest(排序(剪枝))
1055 The World's Richest (25 分)Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed to simulate this job, ...
2019-07-06 10:36:43 182
转载 C/C++ 数学函数 ceil(), floor(), round()(转载)
原文链接:http://zebozhuang.blog.163.com/blog/static/1714798042011325111616224/用法:ceil(x)返回不小于x的最小整数值(然后转换为double型)。floor(x)返回不大于x的最大整数值。round(x)返回x的四舍五入整数值。给个例子test.c: #include <stdio.h&...
2019-07-05 09:46:55 127
原创 java compare 总结:(对应接口 Comparator)
,这个方法是Comparator接口的一个方法public int compare(Object o1, Object o2)本来的顺序就是参数的先后顺序o1、o2;如果保持这个顺序就返回-1,交换顺序就返回1,什么都不做就返回0;所以 升序的话 如果o1<o2,就返回-1。重写compareTo方法,只是重新定义比较的逻辑(1是比2大呢还是比2小呢),默认是升序排...
2019-07-04 21:26:48 462
mfc实现汉诺塔递归
2019-11-01
mfc实现二分法和线性查找
2019-11-01
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人