anhui1277
码龄8年
求更新 关注
提问 私信
  • 博客:3,497
    3,497
    总访问量
  • 暂无
    原创
  • 0
    粉丝
  • 0
    关注
加入CSDN时间: 2017-03-17
博客简介:

anhui1277的博客

查看详细资料
个人成就
  • 获得0次点赞
  • 内容获得0次评论
  • 获得1次收藏
  • 博客总排名1,593,477名
  • 原力等级
    原力等级
    0
    原力分
    0
    本月获得
    0
创作历程
  • 3篇
    2018年
  • 14篇
    2017年
  • 13篇
    2016年
  • 2篇
    2015年

TA关注的专栏 0

TA关注的收藏夹 0

TA关注的社区 0

TA参与的活动 0

创作活动更多

王者杯·14天创作挑战营·第2期

这是一个以写作博客为目的的创作活动,旨在鼓励码龄大于4年的博主们挖掘自己的创作潜能,展现自己的写作才华。如果你是一位热爱写作的、想要展现自己创作才华的小伙伴,那么,快来参加吧!我们一起发掘写作的魅力,书写出属于我们的故事。 注: 1、参赛者可以进入活动群进行交流、分享创作心得,互相鼓励与支持(开卷),答疑及活动群请见https://bbs.csdn.net/topics/619735097 2、文章质量分查询:https://www.csdn.net/qc 我们诚挚邀请你们参加为期14天的创作挑战赛!

62人参与 去参加
  • 最近
  • 文章
  • 专栏
  • 代码仓
  • 资源
  • 收藏
  • 关注/订阅/互动
更多
  • 最近

  • 文章

  • 专栏

  • 代码仓

  • 资源

  • 收藏

  • 关注/订阅/互动

  • 社区

  • 帖子

  • 问答

  • 课程

  • 视频

搜索 取消

回溯算法

回溯算法转载于:https://www.cnblogs.com/pulusite/p/9672025.html
转载
发布博客 2018.09.18 ·
106 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[leetcode] 046. Permutations 解题报告

本题要采用 回溯法 来解决class Solution { public List<List<Integer>> permute(int[] nums) { List<List<Integer>> list = new ArrayList<>(); backtrack(...
转载
发布博客 2018.09.18 ·
136 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[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 ·
111 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

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

本题目可以采用三种方法Straightforward DFS recursive, iterative, BFS solutions1.深度优先 递归2.迭代3.广度优先a.要弄懂final关键字的含义此题不加也行class Solution { public TreeNode invertTree(TreeNode root) { ...
转载
发布博客 2018.09.16 ·
120 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[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 ·
96 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[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 ·
81 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[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 ·
118 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[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 ·
76 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[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 ·
76 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[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 ·
81 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[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<...
转载
发布博客 2016.09.04 ·
82 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[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 ·
87 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[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 ·
93 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[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 ·
78 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[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 ·
71 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

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 ·
567 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

[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 ·
98 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

博文转载

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 ·
79 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[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 ·
71 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

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

c转载于:https://www.cnblogs.com/pulusite/p/4750829.html
转载
发布博客 2015.08.22 ·
140 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏
加载更多