diaobi8410
码龄9年
关注
提问 私信
  • 博客:10,219
    10,219
    总访问量
  • 暂无
    原创
  • 1,444,471
    排名
  • 0
    粉丝
  • 0
    铁粉
IP属地以运营商信息为准,境内显示到省(区、市),境外显示到国家(地区)
IP 属地:浙江省
  • 加入CSDN时间: 2016-04-08
博客简介:

diaobi8410的博客

查看详细资料
  • 原力等级
    领奖
    当前等级
    0
    当前总分
    0
    当月
    0
个人成就
  • 获得0次点赞
  • 内容获得0次评论
  • 获得2次收藏
创作历程
  • 1篇
    2016年
  • 116篇
    2015年
创作活动更多

HarmonyOS开发者社区有奖征文来啦!

用文字记录下您与HarmonyOS的故事。参与活动,还有机会赢奖,快来加入我们吧!

0人参与 去创作
  • 最近
  • 文章
  • 代码仓
  • 资源
  • 问答
  • 帖子
  • 视频
  • 课程
  • 关注/订阅/互动
  • 收藏
搜TA的内容
搜索 取消

[LeetCode]112. 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...
转载
发布博客 2015.12.16 ·
174 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]110. Find Minimum in Rotated Sorted Array旋转数组最小值

Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).Find the minimum element.You may assume no duplicate exists in the...
转载
发布博客 2015.12.15 ·
87 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]109. Construct Binary Tree from Inorder and Postorder Traversal由中序序列和后序序列重建二叉树...

Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.解法:这题和由前序序列和中序序列重建二叉树一样,解法也相同,不过是先根据后序序列的最后一个元素为树根,再...
转载
发布博客 2015.12.14 ·
110 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]105. Word Search单词查找

Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertica...
转载
发布博客 2015.12.11 ·
90 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]103. Find the Duplicate Number重复值查找

Given an arraynumscontainingn+ 1 integers where each integer is between 1 andn(inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate numbe...
转载
发布博客 2015.12.09 ·
84 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]102. Product of Array Except Self数组乘积

Given an array ofnintegers wheren> 1,nums, return an arrayoutputsuch thatoutput[i]is equal to the product of all the elements ofnumsexceptnums[i].Solve itwithout divisionand in...
转载
发布博客 2015.12.09 ·
82 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]101. Trapping Rain Water收集雨水

Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example,Given[0,1,0,2,1,0,1,3,2,1,2,1...
转载
发布博客 2015.12.08 ·
89 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]114. Power of Three 三的幂

Given an integer, write a function to determine if it is a power of three.Follow up:Could you do it without using any loop / recursion?解法1:不断除去n的因子3,最后判断是否为1class Solution {public:...
转载
发布博客 2016.01.29 ·
160 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]113. 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.解法1:很简单的DFS递归。/** * Defi...
转载
发布博客 2015.12.25 ·
164 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]97. Reorder List链表重排序

Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For example,Given {1,2,3,4}, reorder ...
转载
发布博客 2015.12.04 ·
81 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]96. Min Stack带Min函数的栈

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top(...
转载
发布博客 2015.11.19 ·
114 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]111. Find Minimum in Rotated Sorted Array II旋转数组最小值II

Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Suppose a sorted array is rotated at some pi...
转载
发布博客 2015.12.15 ·
138 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]92. Linked List Cycle判断链表是否有环

Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Subscribeto see which companies asked this question解法1:使用两个指针p1, p...
转载
发布博客 2015.11.17 ·
71 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]108. Construct Binary Tree from Preorder and Inorder Traversal由前序序列和中序序列重建二叉树...

Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.解法:前序遍历的第一个元素为树根,因为树中无重复元素,因此遍历一遍可以在中序序列中找出树根所在位置,于是把...
转载
发布博客 2015.12.14 ·
63 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]107. Best Time to Buy and Sell Stock III股票买卖III

Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete at mosttwotransactions.Note:You may n...
转载
发布博客 2015.12.11 ·
66 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]91. Rotate List旋转链表

Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.S...
转载
发布博客 2015.11.17 ·
79 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]89. Partition List链表划分

Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the original relative order of the nodes in each...
转载
发布博客 2015.11.16 ·
68 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]104. Basic Calculator II基本计算器

Implement a basic calculator to evaluate a simple expression string.The expression string contains onlynon-negativeintegers,+,-,*,/operators and empty spaces. The integer division shoul...
转载
发布博客 2015.12.09 ·
109 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]106. Best Time to Buy and Sell Stock II股票买卖II

Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy...
转载
发布博客 2015.12.11 ·
81 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

[LeetCode]81. Palindrome Linked List回文链表

Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?Subscribeto see which companies asked this question解...
转载
发布博客 2015.11.15 ·
67 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏
加载更多