#题目 #代码 #include <unordered_map> #include <vector> using namespace std; class Solution { public: vector<int> twoSum(vector<int> &nums, int target) { v ...
分类:
其他好文 时间:
2021-04-13 12:55:20
阅读次数:
0
一 什么是JSP? JSP全称:javaserver pages java服务器页面。 作用:响应客户端发送的请求,动态生成页面并返回给客户端。 最大的特点: 1)写JSP就像在写HTML 2)区别: HTML只给用户提供静态数据 JSP以页面中可以嵌入java代码,为用户提供动态数据 二 JSP原 ...
分类:
Web程序 时间:
2021-04-13 12:53:46
阅读次数:
0
记录一下java实现文件的上传、下载、删除的功能demo; /** * Controller */ @Slf4j @RestController @RequestMapping public class FileController { @Resource IFileService fileServ ...
分类:
编程语言 时间:
2021-04-13 12:53:13
阅读次数:
0
给你一个二叉搜索树的根节点 root ,返回 树中任意两不同节点值之间的最小差值 。 https://leetcode-cn.com/problems/minimum-distance-between-bst-nodes/ /** * Definition for a binary tree nod ...
分类:
其他好文 时间:
2021-04-13 12:43:51
阅读次数:
0
1. 翻转二叉树:https://leetcode-cn.com/problems/invert-binary-tree/ 2. 二叉树展开为链表,关键在于找到递归部分:https://leetcode-cn.com/problems/flatten-binary-tree-to-linked-li ...
分类:
其他好文 时间:
2021-04-13 12:42:14
阅读次数:
0
题目 783. 二叉搜索树节点最小距离 给你一个二叉搜索树的根节点 root ,返回 树中任意两不同节点值之间的最小差值 。 注意:本题与 530:https://leetcode-cn.com/problems/minimum-absolute-difference-in-bst/ 相同 示例 1 ...
分类:
其他好文 时间:
2021-04-13 12:40:55
阅读次数:
0
思路:遍历判断每个数的正负 class Solution { public: int arraySign(vector<int>& nums) { int ans = 1; for(auto &n : nums){ if(n == 0) return 0; ans *= (n > 0) ? 1 : ...
分类:
编程语言 时间:
2021-04-13 12:40:39
阅读次数:
0
引言 Kotlin是一种非常简洁的语言,它省略了java中许多繁重的写法。 基本语法 入门必学 可变类型var,不可变类型val 函数定义 fun 函数名(arg1: type1, arg2: type2) : returnType{ return returnValue } 例如: fun add ...
分类:
其他好文 时间:
2021-04-13 12:34:15
阅读次数:
0
一个java类中可以有多个class类,但是只能有一个public class。 没有名字初始化类,不用实例保存到变量中。 new Apple().eat(); new UserService() ...
分类:
其他好文 时间:
2021-04-13 12:31:17
阅读次数:
0
异常体系结构 java把异常当做对象,基类java.lang.Throwable作为所有异常的超类。 Java API定义了许多异常类,分为两大类,错误Error和异常Exception。 Exception分支重要的一个子类RuntimeException(运行时异常) 抛出和捕获异常 异常处理五 ...
分类:
其他好文 时间:
2021-04-13 12:29:17
阅读次数:
0