<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[M_Eve的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/M_Eve</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; M_Eve]]></copyright><item><title><![CDATA[react中使用cytoscape]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/132625789</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/132625789</guid><author>M_Eve</author><pubDate>Fri, 01 Sep 2023 16:30:43 +0800</pubDate><description><![CDATA[react中使用cytoscape]]></description><category></category></item><item><title><![CDATA[（js）leetcode 104. 二叉树的最大深度]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/129393155</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/129393155</guid><author>M_Eve</author><pubDate>Tue, 07 Mar 2023 22:33:30 +0800</pubDate><description><![CDATA[（js）leetcode 104. 二叉树的最大深度]]></description><category></category></item><item><title><![CDATA[通过dumi + verdaccio搭建私有组件库]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/126360011</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/126360011</guid><author>M_Eve</author><pubDate>Tue, 16 Aug 2022 10:04:35 +0800</pubDate><description><![CDATA[搭建组件库，并发布到私有服务器]]></description><category></category></item><item><title><![CDATA[（js）leetcode 278. 第一个错误的版本]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/120050016</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/120050016</guid><author>M_Eve</author><pubDate>Wed, 01 Sep 2021 22:12:14 +0800</pubDate><description><![CDATA[题目：

你是产品经理，目前正在带领一个团队开发新的产品。不幸的是，你的产品的最新版本没有通过质量检测。由于每个版本都是基于之前的版本开发的，所以错误的版本之后的所有版本都是错的。
&nbsp;		
假设你有 n 个版本 [1, 2, …, n]，你想找出导致之后所有版本出错的第一个错误的版本。
&nbsp;
你可以通过调用 bool isBadVersion(version) 接口来判断版本号 version 是否在单元测试中出错。实现一个函数来查找第一个错误的版本。你应该尽量减少对调用 API 的次数。]]></description><category></category></item><item><title><![CDATA[防抖和节流实现]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/119941317</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/119941317</guid><author>M_Eve</author><pubDate>Thu, 26 Aug 2021 22:28:21 +0800</pubDate><description><![CDATA[防抖


在事件被触发后 n 秒再执行回调，如果在这 n 秒内又被触发，则重新计时


实现


/**
 * 防抖
 * 在事件被触发后 n 秒再执行回调，如果在这 n 秒内又被触发，则重新计时
 * @param {*} fn 
 * @param {*} wait 
 */
let timer = null;
function debounce(fn, wait) {
  return function () {
    let context = globalThis;
    let args =]]></description><category></category></item><item><title><![CDATA[手写 call、apply 及 bind 函数]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/119918977</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/119918977</guid><author>M_Eve</author><pubDate>Wed, 25 Aug 2021 20:44:45 +0800</pubDate><description><![CDATA[手写 call、apply 及 bind 函数
一、介绍
1）call apply bind 功能：重定义 this 对象   
      bind 返回的是一个新函数，必须调用才会执行   
2）参数

var obj = {   
  name: 'zs',
  objAge: this`在这里插入代码片`.age,
  myFunc: function (fm, t) {
    console.log(this.name + '年龄：' + this.age + ' 来自 ' + fm + ' 去]]></description><category></category></item><item><title><![CDATA[Typescript 学习笔记（二）— 泛型]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/119881986</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/119881986</guid><author>M_Eve</author><pubDate>Tue, 24 Aug 2021 08:40:42 +0800</pubDate><description><![CDATA[什么是泛型，泛型的具体使用

定义：定义函数、接口或类时，不预先指定类型，使用时再指定
使用interfact Test&lt;T = any&gt; {
    userId: T;
}

type TestA = Test&lt;string&gt;;
type TestB = Test&lt;number&gt;;

const a: TestA = {
    userId: '111'
}
const b: TestB = {
    userId: 222
}




...]]></description><category></category></item><item><title><![CDATA[Typescript 学习笔记（一）— 基础知识]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/119879363</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/119879363</guid><author>M_Eve</author><pubDate>Mon, 23 Aug 2021 22:43:35 +0800</pubDate><description><![CDATA[Typescript 学习笔记（一）基础知识
基础知识

enum 枚举 enum Color {Red = 1, Green, Blue}


type, interface
联合类型 |
交叉类型 &amp;
typeof
获取一个变量声明或对象的类型
keyof
获取一个对象中的所有 key 值interface Person {
    name: string;
    age: number;
}
type K1 = keyof Person; // "name" | "age"


in
遍历]]></description><category></category></item><item><title><![CDATA[uni-app 与 renderjs 通信]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/115497269</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/115497269</guid><author>M_Eve</author><pubDate>Wed, 07 Apr 2021 22:06:12 +0800</pubDate><description><![CDATA[一、页面与renderjs模块通信
页面 view 中监听变量 operation
&lt;!-- 监听变量 operation 的变化，operation 发生改变时，调用 test 模块的 loadOperation 方法 --&gt;
&lt;view :operation="operation" :change:operation="test.loadOperation"&gt;
	&lt;!-- 调用 test 模块的 clicked 变量 --&gt;
	test模块：{{test.clicke]]></description><category></category></item><item><title><![CDATA[uni-app 中使用 d3js 绘制图形]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/115472192</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/115472192</guid><author>M_Eve</author><pubDate>Tue, 06 Apr 2021 23:29:30 +0800</pubDate><description><![CDATA[使用d3js绘制地图的例子有很多，使用的都是geojson的格式
本篇文章实现的是，通过svg path路径，将图形绘制出来
先看效果图

下面按步骤介绍如何引用 d3，如果想直接使用整个页面的代码，可以直接拉到文末查看仓库代码
因为 d3 无法直接在 uni-app 页面中使用，所以需要在 renderjs 中进行渲染使用
&lt;script module="map" lang="renderjs"&gt;
&lt;/script&gt;

1. 引入d3
import * as d3 from 'd3]]></description><category></category></item><item><title><![CDATA[（js）leetcode 11. 盛最多水的容器]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/115221435</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/115221435</guid><author>M_Eve</author><pubDate>Thu, 25 Mar 2021 23:20:43 +0800</pubDate><description><![CDATA[题目：


给你 n 个非负整数 a1，a2，...，an，每个数代表坐标中的一个点(i,ai) 。在坐标内画 n 条垂直线，垂直线 i的两个端点分别为(i,ai) 和 (i, 0) 。找出其中的两条线，使得它们与x轴共同构成的容器可以容纳最多的水。

说明：你不能倾斜容器。

示例 1：



输入：[1,8,6,2,5,4,8,3,7]
输出：49
解释：图中垂直线代表输入数组 [1,8,6,2,5,4,8,3,7]。在此情况下，容器能够容纳水（表示为蓝色部分）的最大值为49。
示例 ...]]></description><category></category></item><item><title><![CDATA[（js）leetcode 9. 回文数]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/115190566</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/115190566</guid><author>M_Eve</author><pubDate>Wed, 24 Mar 2021 23:21:43 +0800</pubDate><description><![CDATA[题目：


给你一个整数 x ，如果 x 是一个回文整数，返回 true ；否则，返回 false 。

回文数是指正序（从左向右）和倒序（从右向左）读都是一样的整数。例如，121 是回文，而 123 不是。

示例 1：

输入：x = 121
输出：true
示例2：

输入：x = -121
输出：false
解释：从左向右读, 为 -121 。 从右向左读, 为 121- 。因此它不是一个回文数。
示例 3：

输入：x = 10
输出：false
解释：从右向左读, 为 01 。因此它不是一个回.]]></description><category></category></item><item><title><![CDATA[（js）leetcode 606. 根据二叉树创建字符串]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/115150886</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/115150886</guid><author>M_Eve</author><pubDate>Tue, 23 Mar 2021 23:28:06 +0800</pubDate><description><![CDATA[题目：


你需要采用前序遍历的方式，将一个二叉树转换成一个由括号和整数组成的字符串。

空节点则用一对空括号 "()" 表示。而且你需要省略所有不影响字符串与原始二叉树之间的一对一映射关系的空括号对。

示例 1:

输入: 二叉树: [1,2,3,4]
   1
  /  \
  2   3
 /  
 4  

输出: "1(2(4))(3)"

解释: 原本将是“1(2(4)())(3())”，
在你省略所有不必要的空括号对之后，
它将是“1(2(4))(3)...]]></description><category></category></item><item><title><![CDATA[（js）leetcode 404. 左叶子之和]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/115106269</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/115106269</guid><author>M_Eve</author><pubDate>Mon, 22 Mar 2021 23:52:58 +0800</pubDate><description><![CDATA[题目：


计算给定二叉树的所有左叶子之和。

示例：

  3
 / \
 9 20
  / \
 15  7

在这个二叉树中，有两个左叶子，分别是 9 和 15，所以返回 24


思路：


对整棵树进行遍历

如果左子节点是叶子节点，则累加求和


代码实现：


/**
 * Definition for a binary tree node.
 * function TreeNode(val) {
 *     this.val = val;
 *     this.l...]]></description><category></category></item><item><title><![CDATA[（js）leetcode 106. 从中序与后序遍历序列构造二叉树]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/115055008</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/115055008</guid><author>M_Eve</author><pubDate>Sun, 21 Mar 2021 20:21:11 +0800</pubDate><description><![CDATA[题目：


根据一棵树的中序遍历与后序遍历构造二叉树。

注意:
你可以假设树中没有重复的元素。

例如，给出

中序遍历 inorder =[9,3,15,20,7]
后序遍历 postorder = [9,15,7,20,3]
返回如下的二叉树：

  3
 / \
 9 20
  / \
 15  7


思路：


思路同 105 题

1. 后序遍历的最后一个元素就是 root 节点对应的值

2. 根据后序遍历判断出 root 的值，在对应的中序遍历中可以找到 root...]]></description><category></category></item><item><title><![CDATA[（js）leetcode 190. 颠倒二进制位]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/115037228</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/115037228</guid><author>M_Eve</author><pubDate>Sat, 20 Mar 2021 23:31:18 +0800</pubDate><description><![CDATA[题目：


颠倒给定的 32 位无符号整数的二进制位。

示例 1：

输入: 00000010100101000001111010011100
输出: 00111001011110000010100101000000
解释: 输入的二进制串 00000010100101000001111010011100 表示无符号整数 43261596，
  因此返回 964176192，其二进制表示形式为 00111001011110000010100101000000。
示例 2：

输入：111111111...]]></description><category></category></item><item><title><![CDATA[（js）leetcode 105. 从前序与中序遍历序列构造二叉树]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/115017137</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/115017137</guid><author>M_Eve</author><pubDate>Fri, 19 Mar 2021 22:26:45 +0800</pubDate><description><![CDATA[题目：


根据一棵树的前序遍历与中序遍历构造二叉树。

注意:
你可以假设树中没有重复的元素。

例如，给出

前序遍历 preorder =[3,9,20,15,7]
中序遍历 inorder = [9,3,15,20,7]
返回如下的二叉树：

  3
 / \
 9 20
  / \
 15  7


思路：


画个图对比一下会更容易理解

1. 前序遍历的第一个元素就是 root 节点对应的值

2. 根据前序遍历判断出 root 的值，在对应的中序遍历中可以找到 ro...]]></description><category></category></item><item><title><![CDATA[（js）leetcode 654. 最大二叉树]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/114992923</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/114992923</guid><author>M_Eve</author><pubDate>Thu, 18 Mar 2021 22:47:04 +0800</pubDate><description><![CDATA[题目：


给定一个不含重复元素的整数数组 nums 。一个以此数组直接递归构建的 最大二叉树 定义如下：

二叉树的根是数组 nums 中的最大元素。
左子树是通过数组中 最大值左边部分 递归构造出的最大二叉树。
右子树是通过数组中 最大值右边部分 递归构造出的最大二叉树。
返回有给定数组 nums 构建的 最大二叉树 。

示例 1：


输入：nums = [3,2,1,6,0,5]
输出：[6,3,5,null,2,0,null,null,1]
解释：递归调用如下所示：
- [3,2,1,6,0,5]]></description><category></category></item><item><title><![CDATA[leetcode 195. 第十行]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/114955166</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/114955166</guid><author>M_Eve</author><pubDate>Wed, 17 Mar 2021 23:21:10 +0800</pubDate><description><![CDATA[题目：


给定一个文本文件file.txt，请只打印这个文件中的第十行。

示例:

假设file.txt 有如下内容：

Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10
你的脚本应当显示第十行：

Line 10


思路：


参考

打印第十行 ：sed -n '10p' file.txt
打印一到十行 ：sed -n '1,10p' file.txt
查找指定字符 ...]]></description><category></category></item><item><title><![CDATA[（js）leetcode 986. 区间列表的交集]]></title><link>https://blog.youkuaiyun.com/M_Eve/article/details/114894466</link><guid>https://blog.youkuaiyun.com/M_Eve/article/details/114894466</guid><author>M_Eve</author><pubDate>Tue, 16 Mar 2021 19:00:46 +0800</pubDate><description><![CDATA[题目：


给定两个由一些 闭区间 组成的列表，firstList 和 secondList ，其中 firstList[i] = [starti, endi] 而secondList[j] = [startj, endj] 。每个区间列表都是成对 不相交 的，并且 已经排序 。

返回这 两个区间列表的交集 。

形式上，闭区间[a, b]（其中a &lt;= b）表示实数x的集合，而a &lt;= x &lt;= b 。

两个闭区间的 交集 是一组实数，要么为空集，要么为闭区间。例如，[1...]]></description><category></category></item></channel></rss>