/images/avatar.png

欢迎来到小程的网站

mysql日志篇

undo log、redo log、binlog 有什么用 undo log(回滚日志):是 Innodb 存储引擎层生成的日志,实现了事务中的原子性,主要用于事务回滚和 MVC

LeetCode42接雨水

接雨水 public class leetcode42 { public int trap(int[] height) { int[] temp = new int[height.length]; temp[0] = 0; temp[height.length - 1] = 0; for (int i = 1; i < height.length - 1; i++) { temp[i] = Math.min(maxTargetOfArray(0, i-1, height), maxTargetOfArray(i + 1, height.length - 1, height)) - height[i] > 0 ? Math.min(maxTargetOfArray(0, i-1, height), maxTargetOfArray(i + 1, height.length - 1, height)) - height[i] : 0; } int

LeetCode15三数之和

三数之和 public List<List<Integer>> threeSum(int[] nums) { List<List<Integer>> result = new ArrayList<>(); int n = nums.length; Arrays.sort(nums); for (int first = 0; first < n; first++) { if(first > 0 && nums[first] == nums[first - 1]){ continue; } int third = n - 1; for (int second = first + 1; second < n; second++) { //重复跳过 if(second > first + 1 &&

mysql锁篇

1.mysql有哪些锁 1.1全局锁 锁整个数据库,数据库成为只读状态。应用场景是全库备份, 在备份数据库之前先开启事务,会先创建 Read View,然后