<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[Pausch的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/Pausch</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; Pausch]]></copyright><item><title><![CDATA[Java8新特性——Stream]]></title><link>https://blog.csdn.net/Pausch/article/details/114021351</link><guid>https://blog.csdn.net/Pausch/article/details/114021351</guid><author>Pausch</author><pubDate>Wed, 24 Feb 2021 14:30:16 +0800</pubDate><description><![CDATA[什么是Stream？
Stream（流）是一个来自数据源的元素队列并支持聚合操作

元素是特定类型的对象，形成一个队列。 Java中的Stream并不会存储元素，而是按需计算。
数据源 流的来源。 可以是集合，数组，I/O   channel， 产生器generator 等。    聚合操作 类似SQL语句一样的操作， 比如filter, map, reduce,   find, match, sorted等。

和以前的Collection操作不同， Stream操作还有两个基础的特征：

Pipelin]]></description><category></category></item><item><title><![CDATA[a15 三数之和   垃圾解法]]></title><link>https://blog.csdn.net/Pausch/article/details/113915085</link><guid>https://blog.csdn.net/Pausch/article/details/113915085</guid><author>Pausch</author><pubDate>Sun, 21 Feb 2021 10:51:15 +0800</pubDate><description><![CDATA[public List&lt;List&lt;Integer&gt;&gt; threeSum(int[] nums) {
        List&lt;List&lt;Integer&gt;&gt; res = new LinkedList&lt;&gt;();
        if (nums.length &lt;3)return res;
        Arrays.sort(nums);
        Integer preI=null ,preJ=null,preX=null;
     ]]></description><category></category></item><item><title><![CDATA[leetcode 257 二叉树的所有路径]]></title><link>https://blog.csdn.net/Pausch/article/details/111995384</link><guid>https://blog.csdn.net/Pausch/article/details/111995384</guid><author>Pausch</author><pubDate>Mon, 01 Feb 2021 19:53:40 +0800</pubDate><description><![CDATA[List&lt;String&gt; res = new LinkedList&lt;&gt;();
    public List&lt;String&gt; binaryTreePaths(TreeNode root) {
        dfs(root,"");
        return res;
    }
    void dfs(TreeNode root,String path){
        if (root != null )  {
            StringBui..]]></description><category></category></item><item><title><![CDATA[为什么要用红黑树]]></title><link>https://blog.csdn.net/Pausch/article/details/113359963</link><guid>https://blog.csdn.net/Pausch/article/details/113359963</guid><author>Pausch</author><pubDate>Thu, 28 Jan 2021 22:18:34 +0800</pubDate><description><![CDATA[什么是红黑树

]]></description><category></category></item><item><title><![CDATA[数据库的事务隔离级别 知识总结]]></title><link>https://blog.csdn.net/Pausch/article/details/113094787</link><guid>https://blog.csdn.net/Pausch/article/details/113094787</guid><author>Pausch</author><pubDate>Thu, 28 Jan 2021 20:29:46 +0800</pubDate><description><![CDATA[事务的四大特性？
学习数据库的时候常常会接触到事务, ACID等概念，那么到底什么是数据库的事务，数据库事务又具有哪些特点，和ACID有怎样的关系，事务的隔离级别又是做什么的呢？。
事务及其四大特性？
事务（Transaction）：访问并可能更新数据库中各种数据项的一个程序执行单元（unit），它通常由高级数据库操纵语言或编程语言（如SQL，C++或Java）书写的用户程序的执行所引起。当在数据库中更改数据成功时，在事务中更改的数据便会提交，不再改变。否则，事务就取消或者回滚，更改无效。
举个例子来说，张]]></description><category></category></item><item><title><![CDATA[数据库的索引 看这一篇就够了]]></title><link>https://blog.csdn.net/Pausch/article/details/113080414</link><guid>https://blog.csdn.net/Pausch/article/details/113080414</guid><author>Pausch</author><pubDate>Sun, 24 Jan 2021 17:34:47 +0800</pubDate><description><![CDATA[深入浅出数据库索引
数据库索引原理深入

数据库索引
1. 什么是数据库索引？
MySQL官方对索引的定义为：索引（Index）是帮助MySQL高效获取数据的数据结构。
数据库查询是数据库的最主要功能之一，我们都希望查询数据的速度能尽可能的快，因此数据库系统的设计者会从查询算法的角度进行优化。
????：也可以这样理解**：**索引的作用就相当于目录的作用。打个比方: 我们在查字典的时候，如果没有目录，那我们就只能一页一页的去找我们需要查的那个字，速度很慢。如果有目录了，我们只需要先去目录里查找字的位置，然]]></description><category></category></item><item><title><![CDATA[Final修饰的String真的不能修改吗]]></title><link>https://blog.csdn.net/Pausch/article/details/113073185</link><guid>https://blog.csdn.net/Pausch/article/details/113073185</guid><author>Pausch</author><pubDate>Sun, 24 Jan 2021 10:48:52 +0800</pubDate><description><![CDATA[通过反射可以修改
public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException {
        final String rs = "aaaaaa";
        Field value = rs.getClass().getDeclaredField("value");
        value.setAccessible(true);
        char[] item ]]></description><category></category></item><item><title><![CDATA[Java创建线程的几种方式]]></title><link>https://blog.csdn.net/Pausch/article/details/113027519</link><guid>https://blog.csdn.net/Pausch/article/details/113027519</guid><author>Pausch</author><pubDate>Sat, 23 Jan 2021 09:15:53 +0800</pubDate><description><![CDATA[第一种：继承Thread
首先继承Thread方法，重写Thread的run()方法
在main()方法里创建一个MyThread对象，调用该对象的start()方法，start()方法会通过对系统底层的一系列操作，创建出一个相应的线程，与当前线程并发执行。如果直接调用run()方法，程序将执行完run()方法后才会执行main()方法中后面的代码,这样就是单线程执行而不是多线程并发执行了。
public class MyThread extends Thread {
    @Override
    p]]></description><category></category></item><item><title><![CDATA[Java中各种数据结构的常用方法和遍历方式，用处]]></title><link>https://blog.csdn.net/Pausch/article/details/112856985</link><guid>https://blog.csdn.net/Pausch/article/details/112856985</guid><author>Pausch</author><pubDate>Wed, 20 Jan 2021 20:12:24 +0800</pubDate><description><![CDATA[List
????：ArrayList
        ArrayList&lt;Integer&gt; list = new ArrayList&lt;&gt;();
        System.out.println("常用方法============");
        list.clear();//清空ArrayList
        list.add(1);//添加元素
        list.add(2);
        list.add(3);
        System.out.]]></description><category></category></item><item><title><![CDATA[leetcode 1609 奇偶树]]></title><link>https://blog.csdn.net/Pausch/article/details/112153292</link><guid>https://blog.csdn.net/Pausch/article/details/112153292</guid><author>Pausch</author><pubDate>Sun, 03 Jan 2021 20:47:13 +0800</pubDate><description><![CDATA[public boolean isEvenOddTree(TreeNode root) {
        if (root == null ) return true;
        LinkedList&lt;TreeNode&gt; queue = new LinkedList&lt;&gt;();
        queue.add(root);
        boolean res = true;
        boolean level = true;
        flag :...]]></description><category></category></item><item><title><![CDATA[AQS和ReentrantLock的关系]]></title><link>https://blog.csdn.net/Pausch/article/details/112135594</link><guid>https://blog.csdn.net/Pausch/article/details/112135594</guid><author>Pausch</author><pubDate>Sun, 03 Jan 2021 18:17:46 +0800</pubDate><description><![CDATA[ReentrantLock主要由li大师编写的可重入锁，可以说当时是为了替代synchronized而诞生的，因为synchronized当时是一个重量级锁，消耗性能，可能造成性能的急剧降低，随着后来synchronized的不断的优化，性能逐渐超过ReentrantLock，而ReentrantLock，ReentrantReadWriteLock等锁底层都是基于AQS来实现的。
lock.unlock() 需要写在finally块中。
synchronized是可以作用与方法，类和代码块，是一个自动加锁]]></description><category></category></item><item><title><![CDATA[2021-01-01 ThreadLocal]]></title><link>https://blog.csdn.net/Pausch/article/details/112058689</link><guid>https://blog.csdn.net/Pausch/article/details/112058689</guid><author>Pausch</author><pubDate>Sat, 02 Jan 2021 22:37:32 +0800</pubDate><description><![CDATA[不能轻易去锁，导致线程排队，变慢了，导致down机
@RestController
public class StatController {
    static Integer c= 0;
    synchronized void _add() throws InterruptedException {
        Thread.sleep(100);
        c++;
    }
    @RequestMapping("/stat")
    public Integer stat()]]></description><category></category></item><item><title><![CDATA[leetcode 0403 特定深度节点链表]]></title><link>https://blog.csdn.net/Pausch/article/details/112095904</link><guid>https://blog.csdn.net/Pausch/article/details/112095904</guid><author>Pausch</author><pubDate>Sat, 02 Jan 2021 14:37:58 +0800</pubDate><description><![CDATA[给定一棵二叉树，设计一个算法，创建含有某一深度上所有节点的链表（比如，若一棵树的深度为 D，则会创建出 D 个链表）。返回一个包含所有深度的链表的数组。
    public ListNode[] listOfDepth(TreeNode tree) {//整体思路是层序遍历
        int flag =0 ;
        ListNode[] res = new ListNode[dfs(tree)];

        if (tree == null) return res;
      ]]></description><category></category></item><item><title><![CDATA[leetcode 0405 检查二叉搜索树]]></title><link>https://blog.csdn.net/Pausch/article/details/112095569</link><guid>https://blog.csdn.net/Pausch/article/details/112095569</guid><author>Pausch</author><pubDate>Sat, 02 Jan 2021 14:31:53 +0800</pubDate><description><![CDATA[Integer res = null;
    boolean flag =true;
    public boolean isValidBST(TreeNode root) {
        if (root == null) return true;
        isValidBST(root.left);
        if (res == null) res = root.val;
        else if (root.val &lt;= res) flag = false;
   ]]></description><category></category></item><item><title><![CDATA[leetcode 0408 首个共同祖先]]></title><link>https://blog.csdn.net/Pausch/article/details/112093913</link><guid>https://blog.csdn.net/Pausch/article/details/112093913</guid><author>Pausch</author><pubDate>Sat, 02 Jan 2021 13:56:51 +0800</pubDate><description><![CDATA[TreeNode res = null;//超时
    public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) {
        if (root == null) return null;
        if (dfs(root,p) &amp;&amp; dfs(root,q)){
          if ( (dfs(root.left,p) || dfs(root.left,q)) &amp;&a]]></description><category></category></item><item><title><![CDATA[leetcode 0410 检查子树]]></title><link>https://blog.csdn.net/Pausch/article/details/112093548</link><guid>https://blog.csdn.net/Pausch/article/details/112093548</guid><author>Pausch</author><pubDate>Sat, 02 Jan 2021 10:36:54 +0800</pubDate><description><![CDATA[检查子树。你有两棵非常大的二叉树：T1，有几万个节点；T2，有几万个节点。设计一个算法，判断 T2 是否为 T1 的子树。
如果 T1 有这么一个节点 n，其子树与 T2 一模一样，则 T2 为 T1 的子树，也就是说，从节点 n 处把树砍断，得到的树与 T2 完全相同。
boolean flag = false;
    public boolean checkSubTree(TreeNode t1, TreeNode t2) {
        if (t1 ==null &amp;&amp; t2 =]]></description><category></category></item><item><title><![CDATA[leetcode 0412 求和路径]]></title><link>https://blog.csdn.net/Pausch/article/details/112093472</link><guid>https://blog.csdn.net/Pausch/article/details/112093472</guid><author>Pausch</author><pubDate>Sat, 02 Jan 2021 09:44:54 +0800</pubDate><description><![CDATA[路径只能是从根节点指向叶子节点的方向
public int pathSum(TreeNode root, int sum) {

        if (root == null) return 0;
        return dfs(root,sum) + pathSum(root.left,sum) + pathSum(root.right,sum);
    }
    int  dfs(TreeNode root,int sum){
        if (root == null) retur]]></description><category></category></item><item><title><![CDATA[leetcode 671 二叉树中第二大的数]]></title><link>https://blog.csdn.net/Pausch/article/details/112062580</link><guid>https://blog.csdn.net/Pausch/article/details/112062580</guid><author>Pausch</author><pubDate>Fri, 01 Jan 2021 18:38:53 +0800</pubDate><description><![CDATA[int res =-1;
    public int findSecondMinimumValue(TreeNode root) {
        if (root == null) {
            return res;
        }
    //如果存在子树并且值不相等，那么较大的值就有可能是第二小的
    if (root.left != null &amp;&amp; root.left.val != root.right.val) {
        //获取左右子树中将较]]></description><category></category></item><item><title><![CDATA[leetcode 100 相同的树]]></title><link>https://blog.csdn.net/Pausch/article/details/112062456</link><guid>https://blog.csdn.net/Pausch/article/details/112062456</guid><author>Pausch</author><pubDate>Fri, 01 Jan 2021 18:20:10 +0800</pubDate><description><![CDATA[public boolean isSameTree(TreeNode p, TreeNode q) {
        if (p == null &amp;&amp; q == null) return true;
        else if (p == null || q == null) return false;
        else if (p.val != q.val)
            return false;
        else return isSameTree(p.]]></description><category></category></item><item><title><![CDATA[leetcode 101 对称二叉树]]></title><link>https://blog.csdn.net/Pausch/article/details/112062232</link><guid>https://blog.csdn.net/Pausch/article/details/112062232</guid><author>Pausch</author><pubDate>Fri, 01 Jan 2021 18:19:41 +0800</pubDate><description><![CDATA[public boolean isSymmetric(TreeNode root) {
        if (root == null) return true;

        return check(root.left,root.right);
    }
    boolean check(TreeNode left,TreeNode right){
        if (left == null &amp;&amp; right == null) return true;
        i]]></description><category></category></item></channel></rss>