- 博客(25)
- 资源 (3)
- 收藏
- 关注
原创 算法
//反转链表//输入一个链表,反转链表后,输出新链表的表头。public class Solution {public ListNode ReverseList(ListNode head) {//建立一个新的带假头的空链表;ListNode dummy = new ListNode(0);//遍历旧链表,依次取出旧链表中的每个结点;while(head != null){// 把旧链表中的结点取出来,采用头部插入的方法添加到新链表中ListNode temp = head.next;
2021-03-24 18:22:32
262
原创 算法
import java.util.*;//10.买卖股票的最好时机// 题目描述// 假设你有一个数组,其中第\ i i 个元素是股票在第\ i i 天的价格。// 你有一次买入和卖出的机会。(只有买入了股票以后才能卖出)。请你设计一个算法来计算可以获得的最大收益。// [1,4,2] 3public class Solution {/**** @param prices int整型一维数组* @return int整型*/public int maxProfit (int[] pr
2021-03-24 08:37:38
159
原创 tree
//1.前序遍历//使用递归的前序遍历void preOrder(TreeNode root,List ans){// 边界处理:如果树为空,那么不需要处理if(root != null){// 先访问根结点ans.add(root.val);// 再分别访问左子树preOrder(root.left,ans);// 再访问右子树preOrder(root.right,ans);}}//使用栈完成前序遍历class Solution {public List preorderT
2021-03-23 18:19:13
188
原创 2021-03-23
const { symlink } = require(“fs”);const shallowClone = (target)=>{if(typeof target === ‘object’ && target !== null){const cloneTarget = Array.isArray(target)?[]:{};for(let prop in target){if(target.hasOwnProperty(prop)){cloneTarget[prop]=t
2021-03-23 18:18:38
185
原创 算法
//反转链表//输入一个链表,反转链表后,输出新链表的表头。public class Solution {public ListNode ReverseList(ListNode head) {//建立一个新的带假头的空链表;ListNode dummy = new ListNode(0);//遍历旧链表,依次取出旧链表中的每个结点;while(head != null){// 把旧链表中的结点取出来,采用头部插入的方法添加到新链表中ListNode temp = head.next;
2021-03-23 18:18:05
199
原创 fiber与jsx的关系
JSX与fiber的关系:jsx是一种描述当前组件内容的数据结构,它不包含schedule,reconcile,render所需的相关信息;组件在更新中的优先级,state,B被打上的用于renderer的标记,这些内容都包含在fiber节点中。所以,在组件mount时,Reconciler根据JSX描述的组件内容生成组件对应的Fiber节点。在update时,Reconciler将JSX与Fiber节点保存的数据对比,生成组件对应的Fiber节点,并根据对比结果为Fiber节点打上标记。react
2021-03-22 18:01:53
634
原创 npm install报 dependency tree error
npm install报Unable to resolve dependency tree error when installing npm packages可以使用npm install --legacy-peer-deps来解决下载包
2021-02-25 16:06:36
311
原创 rollup
1.rollup总结:1)rollup可以使你的程序打包后以模块形式加载于其他项目中;2)rollup可以打包输出各种主流类型模块格式,兼容性高;3)rollup可以通过安装插件,对vue,react等主流框架编写的程序进行打包;4)rollup可以通过安装插件实现代码规范化,差错,压缩,uglify,可操作性强。2.项目中对代码进行模块化打包 ,模块化后的代码能非常便利的再其他项目中进行使用,并解决了代码内容变动产生的差异化问题。3.模块化的好处:为项目组建分割化开发,降低复杂度;开发通用li
2020-11-27 11:25:03
684
原创 typeScript
泛型:要考虑可重用解决类。接口之间的复用性,支持不特定的数据类型function getData(value:string):string{return value;}//同时返回string 和number类型(代码冗余)function getData1(value:string):string{return value;}function getData2(value:number):number{return value;}//同时返回string 和number类型 使用
2020-08-05 18:18:00
109
原创 produce
create or replace procedure MSBS_ECOM_OP_CONTACT_PROC(V_ACCT_ID varchar2(15),V_STREAM_NO NUMBER(10))IS-- control variablesV_REC_CNT NUMBER(10) := 0;-- V_STATUS NUMBER := 1; -- Default status to 1 (Success status = 0)V_ERROR_MSG VARCHAR2(250);V_ER
2020-07-29 18:25:28
652
原创 beego框架的使用
Beego的使用开源基于golang的mvc框架,主要用于golang Web开发,beego可以用来快速开发API,Web,后端服务等各种应用。官网:http://beego.mebeego github地址:https://github.com/astaxie/beegobeego脚手架工具安装bee安装bee脚手架go get github.com/beego/beebee 验证是否安装成功创建普通项目:bee new 项目名默认放$GOPANTH的Src目录 go env查看目录
2020-07-29 18:24:53
801
原创 golang
strconv.formatFloat()//第一参数:要传入的值,第二参数:格式化类型第三参数:,保留的小数点(-1不对小数点格式化) 第四参数:类型 传入64或32var f float32 =20.23str2 := strconv.formatFloat(float64(f),‘f’,4,64)str3 := strconv.formatBool(true) //没有任何意义字符型转换成stringa := ‘a’str4 := strconv.formatUnit(uint64(a
2020-07-28 18:04:57
1236
原创 golang基本
strconv.formatFloat()//第一参数:要传入的值,第二参数:格式化类型第三参数:,保留的小数点(-1不对小数点格式化) 第四参数:类型 传入64或32var f float32 =20.23str2 := strconv.formatFloat(float64(f),‘f’,4,64)str3 := strconv.formatBool(true) //没有任何意义字符型转换成stringa := ‘a’str4 := strconv.formatUnit(uint64(a
2020-07-24 17:55:48
210
原创 python3的使用技巧
字典合并:d1 ={‘name’:‘python’}d2 ={‘verison’:3.6}d3 ={‘size’:67MB}d1.updatr(d2)d1.updatr(d3)python3.5以上:{**d1,**d2,**d3}生成新的字典d1 ={‘name’:‘python’}d2 ={‘verison’:3.6}d3 ={‘size’:67MB}也可以快速的生成字典{k:v for d in [d1,d2,d3] for k,v in d.items()}字典访问:
2020-07-20 18:11:04
276
原创 python基础
while boolean_expression:while_suiteelse:else_suiteelse分支为可选部分只要boolean_expression的结果为True,循环就会执行;boolean_expression的结果为False时终止循环,此时如果有else分支,则会执行。break:跳出最内层的循环continue:跳到所处的最近层循环的开始处pass:占位语句else代码块:循环正常终止才会执行,如果循环终止是由break跳出导致的,,else不会执行。l1
2020-07-17 15:38:51
301
原创 ES6
https://github.com/cucygh/fe-materiales6的模块导出功能:export default function(){}webpack自动热部署1.es6中的常量ES5:Object.defineProperty(window,“PI2”,{value:3.1414926,writable:false}ES6:const PI=3.14159262.e...
2019-03-19 21:50:41
148
原创 nginx.conf的配置
#user nobody;worker_processes 1;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pid logs/nginx.pid;events {worker_connections 1024;}h...
2019-03-19 21:50:08
110
原创 angular
angular 双向绑定 依赖注入angularjs的困境:饱受诟病的性能问题和落后于当前WEB发展理念,对手机端支持不够友好angular2:移除controller+$scope设计,改用组件式开发(更容易上手)性能更好(渲染更块,变化检测效率更高)优先为移动应用设计(angular mobile toolkit)更加贴合未来的标准angular2的核心概念:组件,元数据、 模...
2019-01-31 17:55:45
171
原创 javaScrit中delete操作符的用法
js中delete操作符的使用1.var output = (function(x){delete x;return x;})(0);console.log(output);//0输出是 0。 delete 操作符是将object的属性删去的操作。但是这里的 x 是并不是对象的属性, delete 操作符并不能作用。2.var x = 1;var output = (functio...
2018-12-14 11:49:04
910
原创 ziloadd
https://blog.youkuaiyun.com/xm1037782843/article/details/80708533https://www.cnblogs.com/DCL1314/p/7903102.htmlhttps://blog.youkuaiyun.com/sinat_17775997/article/details/79608217https://www.baidu.com/s?wd=html...
2018-12-13 17:38:27
203
原创 ios补充
http://www.itdaan.com/blog/2016/07/26/4d8920a1d5e784e571bd5432d33a9a06.htmlhttp://www.itdaan.com/blog/2017/02/24/267c8304627c.html
2018-10-10 23:17:47
125
判断一个数 n 是不是快乐数
2020-09-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅