自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 VSCode左侧文件折叠展开

现象图:解决方案:1、点击设置2、搜索Compact Folders,取消勾选结果图:

2023-09-22 10:42:27 284

原创 面试题:说说vue2的生命周期函数?说说vue3的生命周期函数?说说vue2和vue3的生命周期函数对比?

四个钩子:beforeCreate、created、beforeMount、mounted。mounted:一般用于操作dom(渲染echarts)beforeDestroy:一般用于清除定时器。created:一般用于发送ajax请求;

2023-08-10 22:49:14 338

原创 面试题:bind、call、apply 区别?如何实现一个 bind?

面试题:bind、call、apply 区别?如何实现一个 bind?一、call()代码描述:二、apply()代码描述:三、bind()—最重要代码描述:四、call、apply、bind 总结一、call()代码描述:二、apply()代码描述:三、bind()—最重要代码描述:应用场景举例:另一种写法如下:四、call、apply、bind 总结

2023-08-07 13:20:30 172

原创 面试题:说说JS的this指向问题?

1、this永远指向一个对象;2、this的指向完全取决于函数调用的位置;可以借鉴这篇文章,说的很详细(点击)总结:1、 以方法的形式调用时, this 是调用方法的对象;2、绑定事件函数 this 指向的是函数的调用者;3、构造函数 this 指向构造函数 new 出来的实例化对象;4、window定时器中的 this 可能指向window也可能指向对象;5、 箭头函数: 箭头函数的 this 按照普通变量对待。比如把他当做 x 变量即可,然后按照作用域链找就行了;6、全局中的this

2023-08-05 15:18:48 162

原创 面试题:请说下什么是重绘和重排(回流)?他们的区别是什么?

○ 重绘不一定引起回流(重排),而回流(重排)一定会引起重绘。

2023-08-03 20:28:15 141

原创 面试题:请说说你对作用域链的理解?

答:- 作用域链:为了内部寻找一个变量的查找规则。从内部向外链(从当前作用域开始找,如果找不到就向外作用域找,当找到就返回);- JavaScript中的作用域分为全局作用域、局部作用域和多个嵌套的作用域形成作用域链;- 当在某个作用域中查找变量时,如果当前作用域没有找到,则向上层作用域查找,上层没有声明,继续向上层查找,一直找到全局作用域。- 找的过程中,找到则使用该变量,没有找到则报错。

2023-08-03 19:58:20 39

原创 面试题:创建JS对象的几种方式?构造函数是什么?new操作符具体干了什么?为什么字符串可以使用length?

可以把对象的多个公共的属性封装到一个函数里面去。

2023-08-02 15:24:48 403

原创 面试题:JS中的String常见方法有哪些?

参数1:字符串中的字符,以这个字符为界限分割成数组;若传入要截止的下标,则返回值为这两个参数中间的位置(前包后不包);若传入,则限制输出数组的长度,多余的项会省略。若参数1为负值,则从该字符串的末尾数,从后往前数,最后一位看做-1。若参数都为负数,从后往前数,把字符串最后一位看做-1,前包后不包。参数2: 选填,要截止的下标,若不传则会截取到末尾。参数2:选填,从该位置开始往后找的,找到返回下标。参数2:length的长度,要截取字符的长度。若存在,则返回该位置的下标,不存在就返回-1。

2023-08-02 11:18:51 91

原创 面试题:说说JavaScript中内存泄漏的几种情况?垃圾回收机制

Javascript 具有自动垃圾回收机制,也就是说,执行环境会负责管理代码执行过程中使用的内存;:垃圾收集器会定期(周期性)找出那些不在继续使用的变量,然后释放其内存;JavaScript最常用的垃圾收回机制。闭包、函数内有全局变量、定时器等等。

2023-08-01 20:13:03 260

原创 面试题:说一说深拷贝和浅拷贝?

问:做过深拷贝吗?说一下深拷贝是怎么实现的。答:做过,深拷贝啊做出来对象,新对象不会影响旧对象,要想实现深拷贝,第一啊,深拷贝要用到函数递归,当我们在普通拷贝的时候没问题,直接进行赋值就行了;但是如果遇到数组的,我们再次调用这个递归函数就可以了;如果遇到的是对象形式,那我再次利用递归,把对象解决;但是一定要先递归数组,再递归对象。

2023-08-01 19:48:38 594 1

原创 面试题:什么是闭包?

简单理解:闭包 = 内层函数 + 外层函数的变量。

2023-07-27 15:06:39 182

原创 面试题:如果前端一次性获取上万条数据,怎么渲染?

如果前端一次性获取上万条数据,怎么渲染?核心思想和做法是:把数据分段、一段一段的加载所以为了实现这个方案,需要先将数据缓存,以便于每次获取分段数据不用再发重复请求,然后每次渲染部分内容,等用户滚动或者其他操作后再渲染下一段内容如果要实现这种数据分段加载读取,比较成熟的方案有1、数据分页2、长列表虚拟滚动数据分页比较常见,就是点击页码去加载数据。只不过不是发请求,而是从事先的缓存里获取长列表虚拟滚动是指:只渲染当前视口范围内的数据,每次即将滚动后最后时又加载下一段内容,所以他也需要配合之

2023-07-05 16:33:34 498

原创 面试题:var、let、const的区别

建议在实际开发中尽可能使用let和const,以避免变量提升和重复声明等问题,并使代码更加易于维护。在涉及到常量定义的情况下,建议使用const来声明变量,以便于识别和维护常量值。

2023-07-05 16:13:45 240

原创 JS中的扁平化数据转换为树形结构数组

【代码】JS中的扁平化数据转换为树形结构数组。

2023-07-05 14:09:06 478 2

原创 网页概念、常用浏览器及内核、Web标准、HTML语法规范和基本结构标签

一、网页1.1、什么是网页?1.2、什么是HTML?(重点)1.3、网页的形成?二、常用浏览器三、浏览器内核四、Web标准(重点)4.1 为什么需要Web标准?4.2 Web标准的构成五、HTML语法规范5.1 基本语法描述5.2 标签关系六、HTML基本结构标签6.1 第一个HTML6.2 基本结构标签总结

2023-02-16 12:58:36 889 1

原创 eclipse 的使用(待完善)

文章目录一、建立普通程序二、建立包(文件夹)三、修改字体大小四、其它一、建立普通程序点击 --->Create a Java project 在 --->Project name 下给程序起个名字,然后点击 Finish。右键点击 --->src--->New--->Class在Name下取个名字,点击 Finish。二、建立包(文件夹)1、右键点击src--->New--->Package。相当于在src这个根目录下创建一个文件夹,然后

2021-09-16 14:30:25 180

原创 用jdk 在windows终端输出中文是乱码的解决办法

安装完jdk之后,用windows终端编译,然后输出,中文变成乱码。原因:Java是通过unicode编码,windows是通过jdk编码,因此编译过程中会出现乱码。解决方法:在windows终端编译时,用javac -encoding utf8 文件名.java 来进行编译!!!注意:文件和类名要一致,不然会编译错误的。...

2021-09-09 11:02:21 5194

原创 jdk安装、编写源文件(Hello World)、环境变量配置

1、直接安装到默认地址,点击下一步就行了。默认路径: C盘–>Program Files–>Java。(64位电脑)2、编写第一个应用程序:Hello World。D盘: 可以在D盘新建一个文件夹为:OnlineCourse–>新建文本文档–>改名为HelloWorld.java–>打开方式为记事本–>编写代码如下:3、进行编译。找到刚刚安装jdk的路径–>点击文件夹 jdk1.8.0_251–>点击 文件夹bin–&gt

2021-09-07 21:23:47 2405 2

原创 Sifid and Strange Subsequences(思维)

A sequence (b1,b2,…,bk) is called strange, if the absolute difference between any pair of its elements is greater than or equal to the maximum element in the sequence. Formally speaking, it’s strange if for every pair (i,j) with 1≤i<j≤k, we have |ai−aj|

2021-06-19 08:40:38 242

原创 CSDN MarkDown编译器 如何更改图片大小

需要用到下面一段<img src="https://img-blog.csdnimg.cn/20210328090145795.jpg" width="30%">举个例子:这个图片太大了,把上面那一段复制下来可以发现是一张其他图片,但是我们要把引号里面的内容换一下换成我们需要的图片即换成这个样子,如果觉得太小了,就可以把30%改大点...

2021-06-06 08:31:25 125

原创 Potions (Easy Version) CodeForces - 1526C1(优先队列)

先讲一下优先队列:top 访问队头元素empty 判断队列是否为空size 返回队列内元素个数push 插入元素到队尾 (并排序)pop 弹出队头元素swap 交换内容升序和降序优先队列:升序队列priority_queue <int,vector,greater > q;降序队列priority_queue <int,vector,less >q;题目链接:https://vjudge.z180.cn/problem/CodeForces-1526C1

2021-06-03 21:27:03 591

原创 Epic Transformation(思维)

You are given an array a of length n consisting of integers. You can apply the following operation, consisting of several steps, on the array a zero or more times:you select two different numbers in the array ai and aj;you remove i-th and j-th elements f

2021-05-31 21:13:56 288

原创 k-LCM (easy version) CodeForces - 1497C1(思维+构造/n分奇偶)

It is the easy version of the problem. The only difference is that in this version k=3.You are given a positive integer n. Find k positive integers a1,a2,…,ak, such that:a1+a2+…+ak=nLCM(a1,a2,…,ak)≤n2Here LCM is the least common multiple of numbers a1,

2021-05-31 20:51:39 292

原创 M-arrays(思维+取余)

You are given an array a1,a2,…,an consisting of n positive integers and a positive integer m.You should divide elements of this array into some arrays. You can order the elements in the new arrays as you want.Let’s call an array m-divisible if for each t

2021-05-31 20:36:29 480

原创 取整函数(ceil、floor、round)

ceil(x)是向上取整,返回的是 大于等于x的一个整数floor(x)是向下取整,返回的是 小于等于x的一个整数round(x)是取大约数,返回的是 四舍五入x的一个整数

2021-05-29 13:56:48 1007

原创 Permutation Sort(思维)

You are given a permutation a consisting of n numbers 1, 2, …, n (a permutation is an array in which each element from 1 to n occurs exactly once).You can perform the following operation: choose some subarray (contiguous subsegment) of a and rearrange the

2021-05-29 08:37:35 448

原创 Balance the Bits(构造)

A sequence of brackets is called balanced if one can turn it into a valid math expression by adding characters ‘+’ and ‘1’. For example, sequences ‘(())()’, ‘()’, and ‘(()(()))’ are balanced, while ‘)(’, ‘(()’, and ‘(()))(’ are not.You are given a binary

2021-05-29 08:21:54 190

原创 A-B Palindrome(回文串 暴力模拟)

You are given a string s consisting of the characters ‘0’, ‘1’, and ‘?’. You need to replace all the characters with ‘?’ in the string s by ‘0’ or ‘1’ so that the string becomes a palindrome and has exactly a characters ‘0’ and exactly b characters ‘1’. No

2021-05-28 21:39:03 291 1

原创 Corrupted Array(思维)

You are given a number n and an array b1,b2,…,bn+2, obtained according to the following algorithm:some array a1,a2,…,an was guessed;array a was written to array b, i.e. bi=ai (1≤i≤n);The (n+1)-th element of the array b is the sum of the numbers in the a

2021-05-28 21:31:26 288

原创 Permutation by Sum(思维+构造)

A permutation is a sequence of n integers from 1 to n, in which all the numbers occur exactly once. For example, [1], [3,5,2,1,4], [1,3,2] are permutations, and [2,3,2], [4,3,1], [0] are not.Polycarp was given four integers n, l, r (1≤l≤r≤n) and s (1≤s≤n(

2021-05-28 21:10:08 285

原创 Education(贪心+枚举+模拟)

Polycarp is wondering about buying a new computer, which costs c tugriks. To do this, he wants to get a job as a programmer in a big company.There are n positions in Polycarp’s company, numbered starting from one. An employee in position i earns a[i] tugr

2021-05-28 20:51:32 221

原创 Tickets(动态规划 dp)

Jesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe who sells the film tickets. He is wandering when could he go back home as early as possible.A good approach, reducing the total time of t

2021-05-28 20:10:38 131

原创 Super Jumping! Jumping! Jumping!(动态规划dp 非连续递增序列求和)

Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now.The game can be played by two or more than two players. It consists o

2021-05-25 19:23:59 92

原创 Halloween Costumes LightOJ - 1422(区间dp)

Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it’s Halloween, these parties are all costume parties, Gappu always selects his costumes in such a way that it bl.

2021-05-18 10:38:13 218 2

原创 Multiplication Puzzle(区间dp)

The multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card out of the row and scores the number of points equal to the product of the number on the card taken and the numbers on

2021-05-18 08:03:08 430 2

原创 Maximum Sum of Products(区间dp)

You are given two integer arrays a and b of length n.You can reverse at most one subarray (continuous subsegment) of the array a.Your task is to reverse such a subarray that the sum ∑i=1nai⋅bi is maximized.InputThe first line contains one integer n (1≤

2021-05-17 20:31:36 238

原创 Arranging The Sheep(移动思维)

You are playing the game “Arranging The Sheep”. The goal of this game is to make the sheep line up. The level in the game is described by a string of length n, consisting of the characters ‘.’ (empty space) and ‘*’ (sheep). In one move, you can move any sh

2021-05-14 21:23:47 726 3

原创 Network(无向图割点,tarjan)

文章目录1. 割点含义2. 题意2.1 输入2.2 输出3.题解4.代码1. 割点含义在一个无向图中,如果有一个顶点,删除这个顶点及其相关联的边后,图的连通分量增多,就称该点是割点,该点构成的集合就是割点集合。简单来说就是去掉该点后其所在的连通图不再连通,则该点称为割点。若去掉某条边后,该图不再连通,则该边称为桥或割边。若在图G中(如下图),删除uv这条边后,图的连通分量增多,则u和v点称为割点,uv这条边称为桥或割边。2. 题意A Telephone Line Company (TLC) i

2021-05-14 17:13:33 830

原创 Guess(前缀和+拓扑排序)

题目提交:https://vjudge.z180.cn/problem/UVA-1423Given a sequence of integers, a1, a2, . . . , an, we define its sign matrix S such that, for 1 ≤ i ≤ j ≤ n,Sij = “ + ” if ai + . . . + aj > 0; Sij = “ − ” if ai + . . . + aj < 0; and Sij = “0” otherwise.

2021-05-10 21:07:50 216 3

原创 The Necklace(欧拉回路+输出欧拉回路路径)

题目链接:https://vjudge.net/problem/UVA-10054题目大意:给出一串数,要求相邻两组数的第一组的第二个数与第二组的第一个数相等,并且,第一组的第一个数要与第n组的第二个数相等。题解:典型的欧拉回路,并输出欧拉回路的路径问题。欧拉回路的条件:没有奇度节点的连通图。记录欧拉回路的路径,用栈记录,先进后出。代码:#include<stdio.h>#include<string.h>#include<math.h>#include

2021-04-30 20:20:32 179 1

空空如也

空空如也

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

TA关注的人

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