- 博客(45)
- 收藏
- 关注
原创 opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error‘ ]
文件中列出的依赖项及其新版本(建议你升级到这些新版本),新版本会用箭头指向。文件中列出的新版本,并为下一步(实际更新)做好准备。这两个命令中的任何一个都会最终安装新的更新;包,用于执行其名称所描述的功能。
2024-12-15 23:11:52
112
原创 Angular的cache文件夹
1)现象:Angular13开始,默认情况下,Angular CLI 会在磁盘上保存一些可缓存的内容,放在.cache文件夹中即使在重新build也不会对该内容进行更新,除非删掉cache中内容才会在重新build后得到一个新的cache。出现的问题:在项目中,有时候会对dependency依赖的文件内容进行修改,在把修改好的内容在node-module中替换好后,期望能够直接在项目中应用到修改后的依赖。解决办法:删除掉cache,重新build -》 得到修改后的依赖包。
2023-07-23 16:38:18
433
原创 复习三——二叉树&分治法
Binary Tree & Divide Conque1.基础recursion:递归iterative:迭代(枚举)二叉树: n个节点二叉树高度的范围:最坏情况:O(n), 最好情况:O(log n)怎样确定是否使用递归?主要看递归的深度。因为递归会涉及到stack,占用的stack的空间进程分配到的空间,深度太大会涉及到stackOverflow的问题。2.Traverse a Binary Tree12 34 51)PreOrder 前序遍历1
2022-03-25 17:54:45
295
原创 复习二——二分搜索
一、二分搜索Given a sorted integer array- nums, and anteger - target.Find the any/first/last position of target in numsReturn -1 if target does not exist.算法复杂度: O(logn)关键点:start + 1 < endstart + (end - start)/2A[mid] =class Solution{ /.
2022-02-26 15:57:24
125
原创 复习一——子集
1.算法题Implement strStr返回字符串target在字符串source中出现的第一个位置结果62%正确率class Solution { /** * **/ public int strStr(String source, String target){ if(source == null || target == null) { return -1; } for(int i=0;
2022-02-22 22:26:02
120
转载 19. 删除链表的倒数第 N 个结点
给你一个链表,删除链表的倒数第n个结点,并且返回链表的头结点。示例 1:输入:head = [1,2,3,4,5], n = 2输出:[1,2,3,5]示例 2:输入:head = [1], n = 1输出:[]示例 3:输入:head = [1,2], n = 1输出:[1]提示:链表中结点的数目为 sz1 <= sz <= 300 <= Node.val <= 1001 <= n <= sz前言在对链表进行操...
2021-12-07 22:40:17
98
转载 4. 寻找两个正序数组的中位数
给定两个大小分别为 m 和 n 的正序(从小到大)数组nums1 和nums2。请你找出并返回这两个正序数组的 中位数 。算法的时间复杂度应该为 O(log (m+n)) 。示例 1:输入:nums1 = [1,3], nums2 = [2]输出:2.00000解释:合并数组 = [1,2,3] ,中位数 2示例 2:输入:nums1 = [1,2], nums2 = [3,4]输出:2.50000解释:合并数组 = [1,2,3,4] ,中位数 (2 + 3) / 2 =..
2021-12-07 22:33:38
89
转载 Z字形变换
将一个给定字符串 s 根据给定的行数 numRows ,以从上往下、从左到右进行Z 字形排列。比如输入字符串为 "PAYPALISHIRING"行数为 3 时,排列如下:P A H NA P L S I I GY I R之后,你的输出需要从左往右逐行读取,产生出一个新的字符串,比如:"PAHNAPLSIIGYIR"。请你实现这个将字符串进行指定行数变换的函数:string convert(string s, int numRows);示例 1:输入:...
2021-12-07 22:25:18
113
原创 Angular-动态组件 Dynamix statics
目的:使用 ComponentFactoryResolver 来动态添加组件。案例需求:设计一个滚动广告牌的实现,广告牌可以滚动播放不同的广告。思路:用只支持静态组件结构的模板实现是不显示的,需要一种新的组件加载方式,它不需要在广告条组件的模板中引用固定的组件。1.指令:背景:在添加组件之前,先要定义一个锚点来告诉Angular要把组件插入到什么地方。解决办法:广告条使用一个名叫AdDirective的辅助指令来在模板中标记出有效的插入点。AdDirective指令注入了Vi
2020-12-17 20:04:57
335
原创 Leetcode——Remove Element
Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place with constant memory.The ...
2018-09-07 21:01:47
168
原创 LeetCode——Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with c...
2018-09-07 21:01:12
178
原创 Leetcode 35. Search Insert Position
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array....
2018-09-07 21:00:30
146
原创 Leetcode 88. Merge Sorted Array(复习必看!!!思路不完整)
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold addi...
2018-09-07 20:59:51
230
原创 Leetcode 66. Plus One(复习必看!!!多次报错!!!)
DGiven a non-negative integer represented as a non-empty array of digits, plus one to the integer.You may assume the integer do not contain any leading zero, except the number 0 itself.The digits ...
2018-09-07 20:59:12
252
原创 Leetcode 53.Maximum Subarray(复习必看!!!完全不会做)
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4],the contiguous subarray [4,-1,2,1] h...
2018-09-07 20:58:22
413
原创 LeetCode 38.count and say
看了题目之后没有想法,只有一个大概是需要递归的想法,其他的不知道,递归的想法也不知道怎么实现。原题 The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11....
2018-09-07 20:57:31
124
原创 其他+java内存模型与线程
1.关于建立了一个声明为父类对象,实例化为子类对象 2.重写和重载 VS. 静态分派和动态分派重载(overload):发生在一个类中,出现了多个具有相同名字的方法,这些方法有不同的参数列表(即参数的数量和参数类型不能完全相同)重写(override):发生在子类和父类之间的,子类中的方法和父类定义的方法具有相同的名字,相同的参数列表和相同的返回类型划重点:虚拟...
2018-09-07 20:55:48
167
原创 线程安全和锁优化(1)(10-41-15)——深入理解JVM
1.线程安全的定义:当多个线程访问一个对象时,如果不用考虑这些线程在运行时环境下的调度和交替执行,也不需要进行额外的同步,或者再调用放进行任何其他的协调操作,调用这个对象的行为都可以获得正确的结果,那么这个对象就是线程安全的。2.java语言中各种操作共享的数据类型:不可变、绝对线程安全、相对线程安全、线程兼容和线程对立1)不可变:final关键字修饰的变量2)绝对的线程安全:【不管运...
2018-09-07 20:54:25
133
原创 线程安全和锁优化
1.线程安全的定义:当多个线程访问一个对象时,如果不用考虑这些线程在运行时环境下的调度和交替执行,也不需要进行额外的同步,或者再调用放进行任何其他的协调操作,调用这个对象的行为都可以获得正确的结果,那么这个对象就是线程安全的。2.java语言中各种操作共享的数据类型:不可变、绝对线程安全、相对线程安全、线程兼容和线程对立1)不可变:final关键字修饰的变量2)绝对的线程安全:【不管运...
2018-09-07 20:53:18
124
原创 maven导入项目出错 Maven: Failed to retrieve plugin descriptor error
解决方案: I had a similar issue with Eclipse and the same steps as Sanders did solve it. It happens because the proxy restricts call to maven repositoryGo to D:\Maven\apache-maven-3.0.4-bin\apache-m...
2018-08-30 15:33:21
1241
原创 【非常没有思路】5. Longest Palindromic Substring
题目意思:找到字符串中的最大长度回文思路:先确定中心,由中心向两边扩展,逐个地扩展中心,直到两边的字符不相等,public class Solution {private int lo, maxLen;public String longestPalindrome(String s) { int len = s.length(); if (len < 2) return s;...
2018-05-28 15:36:19
122
原创 笔试题kugou
编程题 小明去附近的水果店买橙子,水果商贩只提供整袋购买,有每袋6个和每袋8个的包装(包装不可拆分)。可是小明只想购买恰好n个橙子,并且尽量少的袋数方便携带。如果不能购买恰好n个橙子,小明将不会购买。请根据此实现一个程序,要求: 输入一个整数n,表示小明想要购买n(1≤n≤100)个橙子 输出一个整数表示最少需要购买的袋数,如果不能买恰好n个橙子则输出-1 例如,输入20,输出3。思路:不是...
2018-05-09 23:57:05
2752
原创 3. Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "b", with the l...
2018-05-08 23:26:09
128
原创 20. Valid Parentheses
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of brack...
2018-05-07 13:25:11
170
原创 leetcode——9. Palindrome Number
Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.Example 1:Input: 121Output: trueExample 2:Input: -121Output: falseExplanation: F...
2018-05-02 16:10:04
151
原创 leetcode刷题——2. Add Two Numbers
被ListNode的结构玩儿死了,还是不够熟悉,怪自己You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add t...
2018-05-02 15:40:46
223
原创 283 交换0
283.Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], after calling your ...
2018-03-30 14:29:22
167
原创 jdbc之dbcp和c3p0的区别
首先要说:JDBC(Java DataBase Connectivity,java数据库连接)是一种用于执行SQL语句的Java API,可以为多种关系数据库提供统一访问,它由一组用Java语言编写的类和接口组成。JDBC提供了一种基准,据此可以构建更高级的工具和接口,使数据库开发人员能够编写数据库应用程序如果一个项目中如果需要多个连接,如果一直获取连接,断开连接,这样比较浪费资源
2017-11-04 19:42:26
5804
1
原创 leetcode刷题——
我的思路:一开始的时候把题目看错了,正常的题目意思是:已知一列数组有2n个数,两两成对,即n个数对,成对的方式没有给定,但要使得n个数对中的最小值的和最大,并求出最大值。思路:先将数从小到大排列 第一次编:以为是求数对的最小值,于是在心里把排序好的数组后最大和最小两两成对,那么n个数对的最小值就是前n个数之和。结果发现错了。 第二次:重新
2017-09-12 21:15:22
193
1
原创 将文件中内容读入作为java程序的输入
头文件:import java.io.FileReader;方式一: 1.BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 2. reader = new BufferedReader(new FileReader("D:\\workspace\\nfv\\wor
2017-07-26 09:58:46
4547
原创 将Java程序的输出结果写到txt文件中
1.将输出结果输出到txt文件步骤一:头文件 import java.io.FileOutputStream; import java.io.PrintStream; 可能还会提醒抛出错误,于是import java.io.FileNotFoundException;步骤二: Prin
2017-07-25 11:28:45
26645
2
原创 最大流问题Ford-Fulkerson算法
最大传输量网络中有两台计算机s和t,现在想从s传输数据到t。该网络中一共有N台计算机,其中一些计算机之间连有一条单向的通信电缆,每条通信电缆都有对应的1秒钟内所能传输的最大数据量。当其他计算机之间没有数据传输时,在1秒钟内s最多可以传送多少数据到t?将上述网络当做一个有向图。图中每条边e都有对应的最大可能的数据传输量。这样就可以把问题转为如下形式:(1)记每条边对应的实际数据传输量为f
2017-07-11 15:09:59
886
转载 vector(2)
原文地址:http://blog.youkuaiyun.com/hancunai0017/article/details/7032383vector(向量): C++中的一种数据结构,确切的说是一个类.它相当于一个动态的数组,当程序员无法知道自己需要的数组的规模多大时,用其来解决问题可以达到最大节约空间的目的. 用法: 1.文件包含:
2017-07-11 15:06:12
359
转载 vector(1)
原文地址:http://www.cnblogs.com/BeyondAnyTime/archive/2012/08/08/2627666.html1.vector的简单介绍vector作为STL提供的标准容器之一,是经常要使用的,有很重要的地位,并且使用起来也是灰常方便。vector又被称为向量,vector可以形象的描述为长度可以动态改变的数组,功能和数组较为相似。实际上更专业的
2017-07-11 15:00:14
272
原创 数塔问题
题目描述 给定一个数塔,如下图所示。在此数塔中,从顶部出发,在每一节点可以选择走左下或右下,一直走到底层。请找出一条路径,使路径上的数值和最大。 9 12 15 10 6 8
2017-07-04 16:08:00
2307
转载 JS中数组的操作
JS中数组的操作1、数组的创建var arrayObj = new Array(); //创建一个数组var arrayObj = new Array([size]); //创建一个数组并指定长度,注意不是上限,是长度var arrayObj = new Array([element0[, element1[, ...[, elementN]]]]); 创建一个数组并赋值
2017-06-21 20:35:16
266
转载 第一個servlet實現的helloworld網頁實現參考
參考http://blog.youkuaiyun.com/u010371710/article/details/51701026
2017-05-09 16:41:15
227
原创 安装MYSQL碰到的问题
1、找各种安装包,一开始是用MYSQL archieved,结果成功,后来在网上搜到了这位朋友的分享,真的很棒http://download.youkuaiyun.com/download/hjj_yexufei/95883732、安装的时候,是按照这个一步一步走的http://blog.youkuaiyun.com/fanyunlei/article/details/21454645,特别详细!3、安装过程中,
2017-04-16 19:16:17
205
原创 开灯问题
有n盏灯,编号1~n。第1个人把所有灯打开,第2个人按下所有编号为2的倍数的开关(这些灯将被关掉),第3个人按下所有编号为3的倍数的开关(其中关掉的灯将被打开,开着的灯将被关闭),依次类推。一共有k个人,问最后有哪些灯开着? Inputn和k,1≤k≤n≤1000。 Output输出开着的灯编号。 Sample Input7 3Sample Output1 5 6
2016-12-08 14:37:12
298
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人