- 博客(22)
- 收藏
- 关注
原创 List学习要点笔录(1)
AbstractCollection类toArray方法详解这里最值得学习的地方,就是考虑到了多线程的影响。一开始我是没有考虑到的;引以为鉴。 public Object[] toArray() { // 根据当前List大小生成数组 Object[] r = new Object[size()]; // 遍历数组 Iterator<E>...
2019-02-18 09:02:57 226
原创 Windows下PHP配置设置
1、PHP基础配置 下载完了PHP5.6之后,请将php目录下的php.ini-development复制一份,修改为php.ini,因为我们后面要用到一些组件,所以要配置扩展组件的位置,在php.ini中搜索extension_dir关键字,修改,设置为本地的ext文件夹位置即可:2、PHP配置curl在PHP中提供了curl的组件库,curl提供了一系列的方法对数据库
2017-09-28 15:08:25 377
原创 Leetcode110. Balanced Binary Tree
110. Balanced Binary Tree1、原题Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the t
2017-06-06 17:11:39 221
原创 Leetcode141. Linked List Cycle
141. Linked List Cycle1、原题Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?2、题意解析与思路这道题就是让我们判断一个链表中存不存在环的问题。这个问题比较简
2017-06-05 19:27:02 202
原创 Leetcode50. Pow(x, n)
50. Pow(x, n)1、原题Implement pow(x, n).Subscribe to see which companies asked this question.2、题意解析这道题的题意很是简单,就是让我们实现pow(x,n)这个函数。一开始,我想到的是最简单的循环累乘,在这里我们会发现这样超时。因此要改变我们的思路。 我后面
2017-06-05 14:44:27 246
原创 Leetcode59. Spiral Matrix II
59. Spiral Matrix II1、原题Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example,Given n = 3,You should return the following matrix:
2017-06-03 18:48:07 219
原创 Leetcode58. Length of Last Word
Length of Last Word1、原题Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not
2017-06-03 18:11:44 274
原创 Leetcode34. Search for a Range
34. Search for a Range一、原题Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be
2017-05-27 17:24:54 231
原创 Leetcode31. Next Permutation
31. Next Permutation一、原题Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rea
2017-05-22 21:16:59 161
原创 Leetcode20. Valid Parentheses
20. Valid Parentheses1、原题Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct or
2017-05-13 16:54:25 150
原创 LeetCode11. Container With Most Water
11. Container With Most Water1、原题Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints
2017-04-30 23:28:38 235
原创 Leetcode515. Find Largest Value in Each Tree Row
515. Find Largest Value in Each Tree Row1、原题You need to find the largest value in each row of a binary tree.Example:Input: 1 / \ 3 2 / \ \
2017-04-21 23:01:23 208
原创 LeetCode137. Single Number II
137. Single Number II1、原题Given an array of integers, every element appears three times except for one, which appears exactly once. Find that single one.2、题目解析与思路这道题是从Single NumberI发展
2017-04-16 02:24:54 193
原创 leetcode547. Friend Circles
547. Friend Circles1、原题There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct friend of B, and
2017-04-08 19:37:41 182
原创 leetcode15. 3Sum
15. 3Sum1、原题Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.2、解读与思路这道题目的意
2017-04-02 10:36:55 175
原创 LeetCode538. Convert BST to Greater Tree
Convert BST to Greater Tree1、原题Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all keys greate
2017-03-26 14:59:43 945
原创 腾讯云对象存储,PHP与JS对接版本
这几天使用了一下腾讯云的COS对象存储服务,发现在使用中遇到了一些问题,在此记录下来,一是做个记录,二是希望以我的经验帮助到其他的人。1、PHP与JS基本使用指南在我使用腾讯云的COS对象存储服务时,其已经出了V4版本的了;因此之后的内容都是基于V4版本之上的。PHP与JS的基本使用,个人觉得其GITHUB上的文档基本可以理解了;但是在JS上还是出现了问题。PHPSDK的地址:http
2017-03-19 21:57:11 2900
原创 Leetcode6、ZigZag Conversion
ZigZag Conversion1、原题The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibili
2017-03-18 16:39:06 207
原创 leetcode:Longest Substring Without Repeating Characters解题报告
Longest Substring Without Repeating Characters1、原题Given a string, find the length of the longest substring without repeating characters.2、题目解析及分析题目一目了然,很简单,让我们一遍找到一个字符串的最小子串。首先,这道题
2017-03-12 18:43:49 187
原创 leetcode:136. Single Number解题报告
Single Number1、原题Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you imple
2017-03-04 21:08:33 331
原创 leetcode:451. Sort Characters By Frequency解题报告
451. Sort Characters By Frequency1、原题Given a string, sort it in decreasing order based on the frequency of characters.2、题目意思及思考解析题目意思很简单,就是给你一个字符串,根据其字符出现的频率对其重新排序;频率高的排在前面,相同频率的排序不限。如“t
2017-03-04 20:11:55 333
原创 482. License Key Formatting解题报告
482. License Key Formatting1、原题:Now you are given a string S, which represents a software license key which we would like to format. The string S is composed of alphanumerical characters and
2017-02-26 19:23:06 306
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人