<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[m16041902的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/m16041902</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; m16041902]]></copyright><item><title><![CDATA[杂记]]></title><link>https://blog.csdn.net/m16041902/article/details/106130304</link><guid>https://blog.csdn.net/m16041902/article/details/106130304</guid><author>m16041902</author><pubDate>Thu, 14 May 2020 22:30:31 +0800</pubDate><description><![CDATA[行内元素之间的文本节点会造成空隙，可以通过加注释节点或者父元素font-size: 0；来解决。
浏览器渲染主要分以下几个步骤，计算样式-&gt;计算布局-&gt;绘制-&gt;组合层，transform和animation处于组合层这一步骤，而left或margin处于计算布局这一步骤，所以transform会更快，这也是常说的硬件加速。


...]]></description><category></category></item><item><title><![CDATA[git相关操作]]></title><link>https://blog.csdn.net/m16041902/article/details/105960007</link><guid>https://blog.csdn.net/m16041902/article/details/105960007</guid><author>m16041902</author><pubDate>Wed, 06 May 2020 21:55:23 +0800</pubDate><description><![CDATA[git add .	—— 将所有暂存区的文件全部提到工作区
git commit -m  ‘这里是提交描述’  —— 将暂存区的内容提交历史记录区
git branch —— 查看目前的所有分支
git checkout 分支名 	—— 切换分支
git checkout -b 分支名 —— 创建并切换分支
git checkout commitId 文件路径 —— 将文件路径指向的文件退回或者...]]></description><category></category></item><item><title><![CDATA[从上往下打印出二叉树的每个节点，同层节点从左至右打印]]></title><link>https://blog.csdn.net/m16041902/article/details/105620130</link><guid>https://blog.csdn.net/m16041902/article/details/105620130</guid><author>m16041902</author><pubDate>Sun, 19 Apr 2020 18:58:10 +0800</pubDate><description><![CDATA[//从上往下打印出二叉树的每个节点，同层节点从左至右打印
      function print(){
        var params = []
        //添加终止条件
        var index = Array.from(arguments).findIndex(item=&gt;item!==null)
        if(index === -1) return...]]></description><category></category></item><item><title><![CDATA[判断链表有环]]></title><link>https://blog.csdn.net/m16041902/article/details/105600655</link><guid>https://blog.csdn.net/m16041902/article/details/105600655</guid><author>m16041902</author><pubDate>Sat, 18 Apr 2020 16:28:31 +0800</pubDate><description><![CDATA[//如何判断链表有环？

     function Node(ele){
       this.element = ele
       this.next = null
     }
      //首先创建带环链表
      var lian = {
        head: null
      }
      //添加结点
     function append(lian, el...]]></description><category></category></item><item><title><![CDATA[去重合并两个链表]]></title><link>https://blog.csdn.net/m16041902/article/details/105027549</link><guid>https://blog.csdn.net/m16041902/article/details/105027549</guid><author>m16041902</author><pubDate>Sun, 22 Mar 2020 14:27:02 +0800</pubDate><description><![CDATA[在这里插入代码function ListNode(value){
      this.value = value
      this.next = null
    }
    //去重合并两个链表
    function merge(l1,l2){
      var l = new ListNode(0)
      var current = l.head
      l1 = l1....]]></description><category></category></item><item><title><![CDATA[判断数组中是否有和为n的子串，优化时间复杂度]]></title><link>https://blog.csdn.net/m16041902/article/details/105025168</link><guid>https://blog.csdn.net/m16041902/article/details/105025168</guid><author>m16041902</author><pubDate>Sun, 22 Mar 2020 11:43:15 +0800</pubDate><description><![CDATA[var arr=[2,1,3,4,5,6]
     
    function find(arr,n){
      var temp=0;
      for(var i=0;i&lt;arr.length;i++){
        temp+=arr[i]
        if(temp===n){
          return true
        }else if(temp&...]]></description><category></category></item><item><title><![CDATA[二叉树找到和为n的所有路径]]></title><link>https://blog.csdn.net/m16041902/article/details/105021494</link><guid>https://blog.csdn.net/m16041902/article/details/105021494</guid><author>m16041902</author><pubDate>Sun, 22 Mar 2020 10:34:47 +0800</pubDate><description><![CDATA[//本题中的路径指的是从根结点到叶节点
      var tree={
        root:1,
        rchild:{
          root:2,
          rchild:null,
          lchild:{
            root:1,
            rchild:null,
            lchild:null,...]]></description><category></category></item><item><title><![CDATA[最长无重复子串的长度]]></title><link>https://blog.csdn.net/m16041902/article/details/105007376</link><guid>https://blog.csdn.net/m16041902/article/details/105007376</guid><author>m16041902</author><pubDate>Sat, 21 Mar 2020 12:07:01 +0800</pubDate><description><![CDATA[//最长无重复子串
     var str = '123345665434543212'
     function find(str){
       var arr=[]
       var max=0
       for(var i=0;i&lt;str.length;i++){
        if(arr.includes(str[i])){
          if(arr.le...]]></description><category></category></item><item><title><![CDATA[实现降维方法flat]]></title><link>https://blog.csdn.net/m16041902/article/details/104992430</link><guid>https://blog.csdn.net/m16041902/article/details/104992430</guid><author>m16041902</author><pubDate>Fri, 20 Mar 2020 16:07:09 +0800</pubDate><description><![CDATA[//实现flat：Array.prototype.flat(num),根据num降维

      var arr = [1, 2, 3, [5, [6]]];

      Array.prototype._flat = function(num) {
        var arr = this;

        if (num !== 0) {
          var result =...]]></description><category></category></item><item><title><![CDATA[Mac下安装并启动mongodb]]></title><link>https://blog.csdn.net/m16041902/article/details/104891160</link><guid>https://blog.csdn.net/m16041902/article/details/104891160</guid><author>m16041902</author><pubDate>Mon, 16 Mar 2020 08:33:37 +0800</pubDate><description><![CDATA[1、下载链接：mongo下载官网
2、下载结束后将其解压到任意文件夹，本文假设为Users/local/Documents/mongo
3、在mongo下添加两个文件夹data和log，在data中添加文件夹db
4、回到mongo下，进入bin目录，创建mongodb.conf
5、通过vim mongodb.conf命令进入mongodb.conf写入如下内容
port=27017
dbpat...]]></description><category></category></item><item><title><![CDATA[洗牌算法]]></title><link>https://blog.csdn.net/m16041902/article/details/104839788</link><guid>https://blog.csdn.net/m16041902/article/details/104839788</guid><author>m16041902</author><pubDate>Fri, 13 Mar 2020 13:58:40 +0800</pubDate><description><![CDATA[算法基本思路：
共54张牌，得到0-53中的任意随机数，假设得到的随机数是3，将索引为3的元素与第53个元素交换位置，再得到0-52中的任意随机数，操作如上，直到范围为0-0
 //洗牌算法

     //生成数组
     var arr=[]
     for(var i=0;i&lt;10;i++){
       arr.push(i)
     }

     //进行排列
     ...]]></description><category></category></item><item><title><![CDATA[将原生Ajax包装成promise]]></title><link>https://blog.csdn.net/m16041902/article/details/104801508</link><guid>https://blog.csdn.net/m16041902/article/details/104801508</guid><author>m16041902</author><pubDate>Wed, 11 Mar 2020 17:52:44 +0800</pubDate><description><![CDATA[let ajaxPromise = new Promise(resolve, reject){
	let xhr = new XMLHttpRequest(); // 创建XMLHttpRequest对象
	xhr.open(method , url, async); //创建请求
	
	//method：请求方法 'GET'/'POST'
	//url: 请求路径
	//async：规定异步（t...]]></description><category></category></item><item><title><![CDATA[react与vue的区别]]></title><link>https://blog.csdn.net/m16041902/article/details/104798021</link><guid>https://blog.csdn.net/m16041902/article/details/104798021</guid><author>m16041902</author><pubDate>Wed, 11 Mar 2020 15:47:26 +0800</pubDate><description><![CDATA[技术选型：
react

如果应用体积小，且要求速度快，考虑vue（vue更轻量）
如果要构建一个大型应用程序，考虑React （react更复杂，但是技术和生态圈更成熟）
如果要构建一个同时适用于Web端和原生App的框架，考虑React （react兼容移动端）

优缺点对比：
react
优点：专注于view 视图; 社区活跃; React 支持 IE8;
缺点：并不是一个完整的框架，只是一...]]></description><category></category></item><item><title><![CDATA[节流与防抖]]></title><link>https://blog.csdn.net/m16041902/article/details/104797386</link><guid>https://blog.csdn.net/m16041902/article/details/104797386</guid><author>m16041902</author><pubDate>Wed, 11 Mar 2020 15:28:39 +0800</pubDate><description><![CDATA[防抖：将一段时间内的连续操作合为一个操作，在上一次的操作未结束之前无法进行下一次的操作，通过减少函数执行的频率来提高性能，如：scroll事件就可以采用防抖
function debounce(fn, wait){
	var time = null
	return function(){
		var that = this
		var arg = arguments
		if(!time){
		...]]></description><category></category></item><item><title><![CDATA[css动画实现翻转硬币]]></title><link>https://blog.csdn.net/m16041902/article/details/104795703</link><guid>https://blog.csdn.net/m16041902/article/details/104795703</guid><author>m16041902</author><pubDate>Wed, 11 Mar 2020 14:10:32 +0800</pubDate><description><![CDATA[&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;test&lt;/title&gt;
    &lt;style&gt;
    .father {
        width:100px;
        height:100px;
        ...]]></description><category></category></item><item><title><![CDATA[proxy实现数组双向绑定]]></title><link>https://blog.csdn.net/m16041902/article/details/104553924</link><guid>https://blog.csdn.net/m16041902/article/details/104553924</guid><author>m16041902</author><pubDate>Fri, 28 Feb 2020 12:18:46 +0800</pubDate><description><![CDATA[&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;test&lt;/title&gt;
    &lt;style&gt;
     
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;ul&gt;

&...]]></description><category></category></item><item><title><![CDATA[以O(n)复杂度求最大子列和]]></title><link>https://blog.csdn.net/m16041902/article/details/102454834</link><guid>https://blog.csdn.net/m16041902/article/details/102454834</guid><author>m16041902</author><pubDate>Wed, 09 Oct 2019 10:06:37 +0800</pubDate><description><![CDATA[function maxSum(arr) {
        var thisSum = maxSum = 0;
        for (var i = 0; i &lt; arr.length; i++) {
            thisSum += arr[i];
            if (thisSum &gt; maxSum) maxSum = thisSum;
      ...]]></description><category></category></item><item><title><![CDATA[剑指offer（十七）：手动实现bind函数]]></title><link>https://blog.csdn.net/m16041902/article/details/102000015</link><guid>https://blog.csdn.net/m16041902/article/details/102000015</guid><author>m16041902</author><pubDate>Thu, 03 Oct 2019 16:05:08 +0800</pubDate><description><![CDATA[Function.prototype.bind = function(o, ...rest) {
        var self = this;
        var tempFn = function() {};
        //tempFn是一个中转构造函数，位于调用完bind后生成的函数的原型链上，
        //如果调用bind的函数是构造函数那么函数内部的this指向new...]]></description><category></category></item><item><title><![CDATA[剑指offer（十六）：找到数组中和为sum乘积最小的数值对]]></title><link>https://blog.csdn.net/m16041902/article/details/101688464</link><guid>https://blog.csdn.net/m16041902/article/details/101688464</guid><author>m16041902</author><pubDate>Sun, 29 Sep 2019 14:03:26 +0800</pubDate><description><![CDATA[题目描述
给定一个数组，找出数组中两个和为sum且在所有和为sum的数值对中乘积最小的数值对。
分析
将数组从小到大排序，定义两个指针，一个指向数组头i，一个指向数组尾j，当arr[i]+arr[j]&gt;sum，将j指针向左移动，arr[i]+arr[j]&lt;sum，将i指针向右移动。
function sum(arr, s) {
        arr.sort((a, b) =&gt;...]]></description><category></category></item><item><title><![CDATA[剑指offer（十五）：字典序全排列]]></title><link>https://blog.csdn.net/m16041902/article/details/101686388</link><guid>https://blog.csdn.net/m16041902/article/details/101686388</guid><author>m16041902</author><pubDate>Sun, 29 Sep 2019 13:38:37 +0800</pubDate><description><![CDATA[题目描述
输入一个字符串,按字典序打印出该字符串中字符的所有排列。例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,bca,cab和cba。
分析
字典序算法解析：
最小字典序是数组从小到大的排序，最大字典序是最小字典序的倒序。
找到下一个字典序的步骤如下：
1）定义一个指针指向数组的最后一个数，从右向左找到第一个小于自己的右侧相邻元素的元素ai，以ai...]]></description><category></category></item></channel></rss>