现有字典d={'a':24, 'b':32, "c":12}请分别按字典只中的key、value排序? sorted(iterable, key, reverse) 三个参数,iterable是可迭代对象,key是一个函数,用来选取参与比较的元素,reverse则是用来指定排序是倒序还是正序, 默认 ...
分类:
编程语言 时间:
2020-07-07 20:57:34
阅读次数:
95
地址 https://leetcode-cn.com/problems/path-sum/ 给定一个二叉树和一个目标和,判断该树中是否存在根节点到叶子节点的路径, 这条路径上所有节点值相加等于目标和。 说明: 叶子节点是指没有子节点的节点。 示例: 给定如下二叉树,以及目标和 sum = 22, 5 ...
分类:
其他好文 时间:
2020-07-07 19:27:51
阅读次数:
54
题目来源:leetcode104 二叉树的最大深度 题目描述: 给定一个二叉树,找出其最大深度。 二叉树的深度为根节点到最远叶子节点的最长路径上的节点数。 说明: 叶子节点是指没有子节点的节点。 示例: 给定二叉树 [3,9,20,null,null,15,7] 返回它的最大深度 3 。 解题思路: ...
分类:
其他好文 时间:
2020-07-07 10:18:52
阅读次数:
80
链接:https://leetcode-cn.com/problems/jump-game-ii/ 代码 class Solution { public: int jump(vector<int>& nums) { int n = nums.size(); vector<int> f(n); for ...
分类:
其他好文 时间:
2020-07-07 09:32:36
阅读次数:
49
一、简介:Memcached 是一个高性能的分布式,基于内存的key-value存储的对象缓存系统(并不是一个数据库),用于动态Web应用以减轻数据库负载。 二、Memcached下载和安装1、下载和安装Memcached服务端1.1、下载地址下载地址:http://static.runoob.co ...
分类:
系统相关 时间:
2020-07-06 16:31:43
阅读次数:
75
链接:https://leetcode-cn.com/problems/combination-sum/ 代码(dfs) class Solution { public: vector<vector<int>> ans; vector<int> path; vector<vector<int>> c ...
分类:
其他好文 时间:
2020-07-06 16:29:07
阅读次数:
61
一、准备工作 Eureka通过运行多个实例,使其更具有高可用性。事实上,这是它默认的熟性,你需要做的就是给对等的实例一个合法的关联serviceurl。 这篇文章我们基于SpringCloud教程第1篇:Eureka(F版本)文章的工程 二、改造工作 在eureka-server工程中resourc ...
分类:
编程语言 时间:
2020-07-06 16:26:58
阅读次数:
51
设有两个线性基 $\alpha,\beta$,如果 $\beta_i$ 能被 $\theta \bigcup \phi, \theta \subseteq \alpha,\phi \subseteq \{\beta_0,\beta_1,...,\beta_{i-1}\}$ 表示,则把 $\theta... ...
分类:
其他好文 时间:
2020-07-06 10:50:13
阅读次数:
53
bool isMatch(char* s, char* p) { int m=strlen(s); int n=strlen(p); int dp[m+1][n+1]; memset(dp,0,sizeof(dp)); dp[0][0]=true; int i,j; //对边界问题进行处理 for( ...
分类:
其他好文 时间:
2020-07-06 01:27:59
阅读次数:
66
http://acm.hdu.edu.cn/showproblem.php?pid=1059 多重背包题; 如果sum奇数直接continue;不是奇数则判断dp[sum/2]能不能到达; 即dp[sum/2]的方案数是否为0; 注意输出格式!!! 1 #include<bits/stdc++.h> ...
分类:
其他好文 时间:
2020-07-05 22:54:20
阅读次数:
81