自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 回溯算法

回溯算法 转载于:https://www.cnblogs.com/pulusite/p/9672025.html

2018-09-18 23:06:00 127

转载 [leetcode] 046. Permutations 解题报告

本题要采用 回溯法 来解决 class Solution { public List<List<Integer>> permute(int[] nums) { List<List<Integer>> list = new ArrayList<>(); backtrack(...

2018-09-18 23:05:00 150

转载 [leetcode] 226. Invert Binary Tree 解题报告

本题目可以采用三种方法Straightforward DFS recursive, iterative, BFS solutions 1.深度优先 递归 2.迭代 3.广度优先 a.要弄懂final关键字的含义 此题不加也行 class Solution { public TreeNode invertTree(TreeNode root) { ...

2018-09-16 21:46:00 133

转载 [leetcode] 121. Best Time to Buy and Sell Stock 解题报告

动态规划,注意处理当前最大值小于0的情况 public int maxProfit(int[] prices) { if (prices == null || prices.length <= 1) return 0; int curMax = 0,result = 0; for (int i = 1; i < pr...

2017-11-01 18:38:00 127

转载 [leetcode] 112. Path Sum 解题报告

根部到叶子节点路径之和为某值,递归 public boolean hasPathSum(TreeNode root, int sum) { if (root==null) return false; if (root.val==sum && root.left==null && root.right==null) ...

2017-10-31 18:09:00 94

转载 [leetcode] 190. Reverse Bits 解题报告

递归,注意结果的三重判断 public boolean isBalanced(TreeNode root) { if (root==null) return true; return Math.abs(getHeight(root.left)-getHeight(root.right)) <=1 && isBalanced(...

2017-10-31 14:46:00 114

转载 [leetcode] 189. Rotate Array 解题报告

The basic idea is that, for example, nums = [1,2,3,4,5,6,7] and k = 3, first we reverse [1,2,3,4,5,6,7], it becomes[7,6,5,4,3,2,1]; then we reverse[7,6,5], it becomes[5,6,7], finally we reverse t...

2017-10-31 10:29:00 91

转载 [leetcode] 100. Same Tree 解题报告

Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical and the nodes have the same value. 空值判断+递归 ...

2017-09-27 07:53:00 84

转载 [leetcode] 88. Merge Sorted Array 解题报告

Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array. Note:You may assume thatnums1has enough space (size that is greater or equal tom+n) to hold addi...

2017-09-27 07:50:00 89

转载 [leetcode] 83. Remove Duplicates from Sorted List 解题报告

Given a sorted linked list, delete all duplicates such that each element appear onlyonce. For example,Given1->1->2, return1->2.Given1->1->2->3->3, return1->2->3. ...

2017-09-27 07:11:00 79

转载 [leetcode] 70. Climbing Stairs 解题报告

You are climbing a stair case. It takesnsteps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Note:Givennwill be a pos...

2017-09-26 23:08:00 90

转载 [leetcode] 69. Sqrt(x) 解题报告

Implementint sqrt(int x). Compute and return the square root ofx. using only integer division for the Newton method works public int mySqrt(int x) { long r=x; while (r*r...

2017-09-26 22:44:00 78

转载 [leetcode] 67. Add Binary 解题报告

Given two binary strings, return their sum (also a binary string). For example,a ="11"b ="1"Return"100". 判断数字时用charAt(i)-'0'即可 public String addBinary(String a, String b) { Strin...

2017-09-26 21:22:00 80

转载 [leetcode] 66. Plus One 解题报告

Given a non-negative integer represented as anon-emptyarray of digits, plus one to the integer. You may assume the integer do not contain any leading zero, except the number 0 itself. The dig...

2017-09-25 23:23:00 108

转载 [leetcode] 058. Length of Last Word 解题报告

Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string. If the last word does not exist, return 0. Note:A word is ...

2017-09-25 21:12:00 101

转载 flag找工作参考博客

http://blog.youkuaiyun.com/linhuanmars/article/category/2336231 转载于:https://www.cnblogs.com/pulusite/p/7202067.html

2017-07-18 18:31:00 126

转载 博文目录

java基础 反射 注解 代理 泛型 异常 IO NIO Object类 JVM 内存模型 类加载机制 调优 Tomcat调优 java并发 JMM volatile synchronized lock AQS Condition 线程池原理 java集合 java集合架构概况 HashMap ArrayLis...

2017-06-01 11:33:00 189

转载 比较好的博文例子

leetcode好博文:http://blog.youkuaiyun.com/crazy1235/article/details/51420522 转载于:https://www.cnblogs.com/pulusite/p/5840748.html

2016-09-04 23:21:00 180

转载 [leetcode] 100. Same Tree 解题报告

Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical and the nodes have the same value. 递归遍历 一刷:...

2016-09-04 23:17:00 100

转载 [leetcode] 237. Delete Node in a Linked List 解题报告

Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is1 -> 2 -> 3 -> 4and you are given the third nod...

2016-09-04 23:11:00 83

转载 [leetcode] 349. Intersection of Two Arrays 解题报告

Given two arrays, write a function to compute their intersection. Example:Givennums1=[1, 2, 2, 1],nums2=[2, 2], return[2]. Note: Each element in the result must be unique. The result...

2016-09-04 23:08:00 93

转载 [leetcode] 283. Move Zeroes 解题报告

Given an arraynums, write a function to move all0's to the end of it while maintaining the relative order of the non-zero elements. For example, givennums = [0, 1, 0, 3, 12], after calling yo...

2016-09-04 23:02:00 99

转载 [leetcode] 389. Find the Difference 解题报告

Given two stringssandtwhich consist of only lowercase letters. Stringtis generated by random shuffling stringsand then add one more letter at a random position. Find the letter that was...

2016-09-04 22:58:00 131

转载 [leetcode] 104. Maximum Depth of Binary Tree

Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. 递归遍历 左子树 和 右子树 一刷: public...

2016-09-04 22:54:00 98

转载 [leetcode] 258. Add Digits

Given a non-negative integernum, repeatedly add all its digits until the result has only one digit. For example: Givennum = 38, the process is like:3 + 8 = 11,1 + 1 = 2. Since2has only o...

2016-09-04 22:42:00 88

转载 [leetcode] 136. Single Number

Given an array of integers, every element appearstwiceexcept for one. Find that single one. Note:Your algorithm should have a linear runtime complexity. Could you implement it without using ex...

2016-09-04 22:18:00 87

转载 [leetcode] 371. Sum of Two Integers 解题报告

Calculate the sum of two integersaandb, but you arenot allowedto use the operator+and-. Example:Givena= 1 andb= 2, return 3. 用 异或 表示sum,与 表示 carry,carry左移一位后,递归调用getSum(sum,carry&lt...

2016-09-04 22:02:00 100

转载 [leetcode] 292. Nim Game 解题报告

You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will b...

2016-09-04 21:54:00 114

转载 [leetcode] 344.Reverse String 解题报告

Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". 即反转字符串,逆序遍历依次append到StringBuffer即可 一刷: public String reverseStr...

2016-09-04 21:49:00 104

转载 leetcode刷题记录--至少要刷3遍--必须每天更新

2016.9.2 刷11题(加以前刷的) 344、292、371、136、258、104 之前: 1、7、9、26、27 共374题 剩余363题 2016.9.3 刷5题 389、283、349、237、100 共刷16题 剩余358题 转载于:https://www.cnblogs.com/pulusite/p/5837616.html...

2016-09-03 17:36:00 601

转载 博文转载

eclipse快捷键:ctrl+f11 运行 http://www.360doc.com/content/08/1120/16/16915_1965253.shtml 转载于:https://www.cnblogs.com/pulusite/p/5037874.html

2015-12-11 02:56:00 93

转载 用c与数据结构算法最难的挑战开始自己的编程旅程吧

c 转载于:https://www.cnblogs.com/pulusite/p/4750829.html

2015-08-22 18:28:00 153

空空如也

空空如也

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

TA关注的人

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