自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 2021-01-28

class Solution { public boolean isPowerOfTwo(int n) { if (n == 0) return false; while (n % 2 == 0) n /= 2; return n == 1; } } class Solution { public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) { List&lt

2021-01-28 01:18:29 91

原创 2021-01-26

class Solution { public boolean isPowerOfTwo(int n) { if (n == 0) return false; while (n % 2 == 0) n /= 2; return n == 1; } } class Solution { public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) { List&lt

2021-01-26 21:18:45 57

原创 2021-01-25

class Solution { Random random = new Random(); public int findKthLargest(int[] nums, int k) { return quickSelect(nums, 0, nums.length - 1, nums.length - k); } public int quickSelect(int[] a, int l, int r, int index) { int

2021-01-25 16:30:06 59

原创 2021-01-23

class LRUCache extends LinkedHashMap<Integer, Integer>{ private int capacity; public LRUCache(int capacity) { super(capacity, 0.75F, true); this.capacity = capacity; } public int get(int key) { return sup

2021-01-23 23:54:50 50

原创 2021-01-23

class Solution { public int singleNumber(int[] nums) { Map<Integer, Integer> hm = new HashMap<Integer, Integer>(); for (int i = 0; i < nums.length; i++) { if (!hm.containsKey(nums[i])) { hm.put(nums[i], 1); }

2021-01-23 00:01:48 46

原创 2021-01-21

class Solution { int maxSum = Integer.MIN_VALUE; public int maxPathSum(TreeNode root) { maxGain(root); return maxSum; } public int maxGain(TreeNode node) { if (node == null) { return 0; }

2021-01-21 20:39:34 46

原创 2021-01-20

class Solution { public void merge(int[] nums1, int m, int[] nums2, int n) { int i = m - 1, j = n - 1, k = m + n - 1; while (i >= 0 && j >= 0) { if (nums1[i] > nums2[j]) { nums1[k--] = nums1[i]; --i; } .

2021-01-20 21:20:36 46

原创 2021-01-19

class Solution { public int uniquePaths(int m, int n) { int[][] f = new int[m][n]; for (int i = 0; i < m; ++i) { f[i][0] = 1; } for (int j = 0; j < n; ++j) { f[0][j] = 1; } f

2021-01-19 20:10:53 38

原创 2021-01-19

class Solution { public List<Integer> spiralOrder(int[][] matrix) { List<Integer> order = new ArrayList<Integer>(); if (matrix == null || matrix.length == 0 || matrix[0].length == 0) { return order;

2021-01-19 02:20:33 85

原创 2021-01-18

// max保存的是全局最大子序列和,pre保存的是包含nums[n-1]的n-1序列最大连续子序列 int max = nums[0]; int pre = 0; for (int i = 1; i < nums.length; i++) { // 先对pre做维护 if (nums[i] + pre >= nums[i])// 其实就是前面是个正数 { pre = nums[i] + pre; } ...

2021-01-18 02:34:29 85

原创 2021-01-17

class Solution { public ListNode mergeKLists(ListNode[] lists) { return merge(lists, 0, lists.length - 1); } public ListNode merge(ListNode[] lists, int l, int r) { if (l == r) { return lists[l]; } i

2021-01-17 01:50:14 67

原创 2021-01-15

class Solution { public int threeSumClosest(int[] nums, int target) { Arrays.sort(nums); int n = nums.length; int best = 10000000; // 枚举 a for (int i = 0; i < n; ++i) { // 保证和上一次枚举的元素不相等

2021-01-15 23:27:49 50

原创 2021-01-14

class Solution { public String longestCommonPrefix(String[] strs) { if (strs == null || strs.length == 0) { return ""; } String prefix = strs[0]; int count = strs.length; for (int i = 1; i < count;

2021-01-14 02:08:12 45

原创 2021-01-13

class Solution { public int myAtoi(String str) { Automaton automaton = new Automaton(); int length = str.length(); for (int i = 0; i < length; ++i) { automaton.get(str.charAt(i)); } return (int) (a

2021-01-13 00:19:55 50

原创 Task05打卡

5.1 窗口函数 窗口函数概念及基本的使用方法 窗口函数也称为OLAP函数。OLAP 是OnLine AnalyticalProcessing 的简称,意思是对数据库数据进行实时分析处理。 <窗口函数> OVER ([PARTITION BY <列名>] ORDER BY <排序用列名>) *[]中的内容可以省略。 窗口函数最关键的是搞明白关键字PARTITON BY和ORDER BY的作用。 PARTITON BY是用来分组,即选择要看哪个窗口,类似于GROUP

2020-12-25 20:33:34 59

原创 Task04笔记

11

2020-12-23 00:16:57 50

原创 Task03

视图时基于某个查询结果的虚表作用是方便用户对数据进行操作 使用sql语句创建视图 可以使用CREATE VIEW语句来创建视图CREATE VIEW 视图名字 AS SELECT 语句 create view v_scors as select * from score; 修改视图: ALTER VIEW 视图名 AS SELECT 语句; 在视图中插入一行数据 INSERT INTO view_班级信息 values(‘7’,‘25’); 删除视图 DROP VIEW <视图名> 索引的基本概

2020-12-20 23:05:15 72

原创 2020-12-19

Task02:基础查询与排序笔记 2.1 SELECT语句基础 2.1.1 基础 SELECT <列名>, FROM <表名>; 2.1.2 条件 SELECT <列名>, …… FROM <表名> WHERE <条件表达式>; 2.1.3 相关法则 (1)星号()代表全部列的意思。 (2)可以随意换行,但不可有空行 (3)设定汉语别名时需要使用双引号(")括起来。 (4)DISTINCT可以删除重复行 (5)单行注释 – 多行注释 / / (6)

2020-12-19 01:06:44 64 1

原创 Task00_Task01打卡

T00 T01 笔记 1、数据库种类 层次数据库、关系数据库、面向对象数据库、XML数据库、键值存储系统 2、RDBMS的常见系统结构 3、DDL CREATE : 创建数据库和表等对象 DROP : 删除数据库和表等对象 ALTER : 修改数据库和表等对象的结构 4、DML(重要) SELECT :查询表中的数据 INSERT :向表中插入新数据 UPDATE :更新表中的数据 DELETE :删除表中的数据 5、DCL COMMIT : 确认对数据库中的数据进行的变更 ROLLBACK : 取

2020-12-15 23:52:50 130

原创 AI学习第一次打卡

打卡_第一次 0基础,所以是把讲义保存成PDF,在iPad边听课,边写笔记的。 把笔记上传到百度云里了: 链接:https://pan.baidu.com/s/1gUxjADEnrqQFmaHJu48FPQ 提取码:ts9c ...

2020-02-14 21:25:15 252

空空如也

空空如也

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

TA关注的人

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