- 博客(21)
- 收藏
- 关注
原创 面试准备:后端知识
UML用例图:从用户角度描述系统功能。类图:描述系统中类的静态结构。对象图:系统中的多个对象在某一时刻的状态。状态图:是描述状态到状态控制流,常用于动态特性建模活动图:描述了业务实现用例的工作流程顺序图:对象之间的动态合作关系,强调对象发送消息的顺序,同时显示对象之间的交互协作图:描述对象之间的协助关系构件图:一种特殊的UML图来描述系统的静态实现视图部署图:定义系统中软硬件的物理体系结构包图:对构成系统的模型元素进行分组整理的图组合结构图:表示类或者构建内部结构的图交互概览图:用活
2020-10-09 11:53:29
202
原创 面试准备:html/CSS
htmlCSS文档流refer什么是文档流所有div 按顺序排列形成文档流,如果有一div脱离文档流,会导致补上的div被覆盖。目前常见的会影响元素脱离文档流的css属性有:①float浮动。 -> 中间建立一个新div {clear:both}②position的absolute和fixed定位。 -> 建立一个新div3 代替div2 设置和div1高度一样,恢复和原来未改变的文档流...
2020-10-08 14:44:31
105
原创 面试准备:网络/操作系统
网络OSI七层模型应用层:HTTP;HTTPS;FTP; SMTP;POP3表示层会话层传输层:TCP;UDP网络层:IP;IPV4;IPV6数据链路层物理层邮件发送运用SMTP和接收运用POP3电子邮件的协议后端UML用例图:从用户角度描述系统功能。类图:描述系统中类的静态结构。对象图:系统中的多个对象在某一时刻的状态。状态图:是描述状态到状态控制流,常用于动态特性建模活动图:描述了业务实现用例的工作流程顺序图:对象之间的动态合作关系,强调对象发送消息的顺序,同时显示对
2020-10-05 12:36:37
136
原创 面试准备:数据库
html / css数据库count(1), count(field/字段), count(*), count(column)一般情况下select count() 与select count(1)两者返回的结果一致但是针对表中主键的有无,情况会有不同。无主键:count(1)比count(列名)快有主键:count(主键/列名)最快count()与count(1)都包括null统计,而count(column)不包括null统计网络OSI七层模型应用层:HTTP;HTTPS;FTP;
2020-09-23 21:40:57
127
原创 面试准备:数据结构/JavaScript
JS 函数reduce1.求和function sum(arr) { return arr.reduce(function(prev, sum){ return prev + sum; }, 0); map不改变原数组,返回新数组arr.map(function(item){return item*item})函数声明 vs 函数表达式Function name(){} --> 函数可提升,可以在此函数之前执行和解析var name
2020-09-22 17:12:54
153
原创 2020面经:逻辑题
华为一个池子有无限多的谁,用5升的桶和6升的桶如何取3升的水?解答: 5装满后倒到6,现在5空,6有5,5装满倒入6,现在5有4,6有6,6倒掉,把5的倒入6,5空,6有4,现在装满5,把5倒6,5有3,6有6。在5升桶得到3升水。...
2020-09-13 22:05:48
331
原创 JS Leetcode 79.单词搜索
题目给定一个二维网格和一个单词,找出该单词是否存在于网格中。单词必须按照字母顺序,通过相邻的单元格内的字母构成,其中“相邻”单元格是那些水平相邻或垂直相邻的单元格。同一个单元格内的字母不允许被重复使用。示例:board =[[‘A’,‘B’,‘C’,‘E’],[‘S’,‘F’,‘C’,‘S’],[‘A’,‘D’,‘E’,‘E’]]给定 word = “ABCCED”, 返回 true给定 word = “SEE”, 返回 true给定 word = “ABCB”, 返回 false
2020-09-13 12:09:01
390
原创 JS LeetCode 637.二叉树的层平均值
题目:给定一个非空二叉树, 返回一个由每层节点平均值组成的数组。示例 1:输入:3/ 9 20/ 15 7输出:[3, 14.5, 11]解释:第 0 层的平均值是 3 , 第1层是 14.5 , 第2层是 11 。因此返回 [3, 14.5, 11] 。tag: 二叉树,广度遍历,queue队列,array数组思路:这就是简单的广度遍历的题,套用BFS templateconst queue = [root];while (queue.length != 0)
2020-09-12 19:56:22
399
原创 JS知识:变量,赋值,拷贝,参数传递
Mutable vs. Immutableimmutableimmutable 变量是不可变变量/原始变量,它一旦创建,在整个生命周期内都是不可以改变的。在JavaScript中只有以下几种变量是不可变变量:字符串, 数字,boolean,其它所有变量都是可变变量。let a = "this is a string"; let b = a.slice(0,4);//a没有变化,就是不可变变量,string 有concat函数,并非改变原来的string的生命周期。要注意的是,仅当直接赋值时
2020-08-22 08:22:34
525
原创 JS Leecode 143.Reorder List
143.Reorder List题意:Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You may not modify the values in the list’s nodes, only nodes itself may be changed.Example 1:Given 1->2->3->4, reorder it to 1->4->
2020-08-21 04:05:59
112
原创 JS Leetcode967.Numbers With Same Consecutive Differences
967.Numbers With Same Consecutive Differences题意:Return all non-negative integers of length N such that the absolute difference between every two consecutive digits is K.Note that every number in the answer must not have leading zeros except for the numb
2020-08-20 04:47:08
136
原创 JS Leecode 1046. Last Stone Weight
1046. Last Stone Weight关键词:排序,贪心思路:在数组中找到第一大x和第二大y,除掉这两个数,加入(y-x)元素。最后最多只剩下一个元素,返回这个元素的数值。解答:var lastStoneWeight = function(stones) { if (!stones || stones.length == 0) return 0; //no last stone if (stones.length == 1) return stones[0]; //only
2020-08-18 08:32:40
118
原创 JS 1005. Leecode Maximize Sum Of Array After K Negations
1005. Leecode Maximize Sum Of Array After K Negations关键词:贪心思路:排序或者用函数库min,找到数组最小值。每次只要将最小值去负,直到用完K次。解答:var largestSumAfterKNegations = function(A, K) { if (!A || A.length == 0 || K == 0) return 0; while (K > 0){ let min = Math.min(.
2020-08-18 08:05:48
189
原创 JS 1103. Distribute Candies to People
1103 Distribute Candies to People题意:从左到右发糖果,后面的比前面那个人多有一个糖果,如果发到最后一个人,则重头从左边发糖果,给糖果数目递增,直到发完为止。关键词:Math思路:如何回到第一人,再发糖果呢?用i % num_people i++解答:var distributeCandies = function(candies, num_people) { if (!candies || candies == 0) return []; //no
2020-08-18 05:40:35
156
原创 LeetCode3道股票题
121. Best Time to Buy and Sell Stock题目:买操作必须在卖操作之前,最多交易一次。得到最大利润关键词: 动态规划, array思路:动态规划初始值和动态变量(不需要数组,因为只需要最大profit值,和求子数组最大max一样)。因为只是交易一次,只要确定谁是卖价和买价。初始买价格,判断prices[i] - buy 是否比存的profit大。如果是,更新profit。判断prices[i]和buy谁大,如果新的prices[i]比存的buy小,更新buy。解
2020-08-17 13:37:02
186
原创 JAVASCRIPT Leetcode435. Non-overlapping Intervals
435. Non-overlapping Intervals题目:Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.Example 1:Input: [[1,2],[2,3],[3,4],[1,3]]Output: 1Explanation: [1,3] can be r
2020-08-16 01:44:55
148
原创 JAVASCRIPT Leetcode409.Longest Palindrome
409.Longest Palindrome题目:Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters.This is case sensitive, for example “Aa” is not considered a palindrome here.Note:
2020-08-15 11:13:23
221
原创 JAVASCRIPT Leetcode1370. Increasing Decreasing String
1370 Increasing Decreasing String题目:Given a string s. You should re-order the string using the following algorithm:Pick the smallest character from s and append it to the result. Pickthe smallest character from s which is greater than the last appende
2020-08-14 14:50:33
141
原创 JAVASCRIPT Leecode 1286. Iterator for Combination
Leecode 1286. Iterator for Combination(JavaScript)关键词:design, backtracking思路:建立ES6 class结构在constructor中,建立一个数组存放所有这个字符串的组合结构,时间复杂度是C(n k), 也就是O(n ^ min(k, n-k))。组合结构由backtrack回溯实现。/** * @param {string} characters * @param {number} combinationLengt
2020-08-14 06:59:47
252
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人