- 博客(23)
- 资源 (2)
- 收藏
- 关注
原创 leetcode 260. Single Number III
Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once. For example: Given
2017-01-19 18:48:55 173
原创 92. Reverse Linked List II
92. Reverse Linked List II Add to List Question Editorial Solution My Submissions Total Accepted: 94390Total Submissions: 316489Difficulty: MediumContributors: Admin
2017-01-19 18:48:16 378
转载 从事务隔离级别谈到Hibernate乐观锁,悲观锁
先提一下基础知识,数据库事务的4个基本特性: 1.Atomic(原子性) 事务中包含的操作被看成一个逻辑单元,这个单元要么全部完成,要么全部没做。 2.Consistency(一致性) 隔离执行事务时(在没有其他事务并发的情况下)保持数据库的一致性。举例说明:A转账给B,那么此事务执行前和执行后A账户和B账户的总和是不变的。 3.Isolation(隔离性) 尽
2017-01-19 09:43:30 340
原创 leetcode 105. Construct Binary Tree from Preorder and Inorder Traversal
105. Construct Binary Tree from Preorder and Inorder Traversal Add to List Question Editorial Solution My Submissions Total Accepted: 87299Total Submissions: 283479D
2017-01-19 01:05:47 356
原创 leetcode 106. Construct Binary Tree from Inorder and Postorder Traversal
106. Construct Binary Tree from Inorder and Postorder Traversal Add to List Question Editorial Solution My Submissions Total Accepted: 74340Total Submissions: 239891
2017-01-19 01:03:57 317
原创 前序遍历和中序遍历 重建树
在Leetcode分类下的105和106两个题目,是对这个问题的最好诠释。 链接如下: http://blog.csdn.net/weililansehudiefei/article/details/54608679 http://blog.csdn.net/weililansehudiefei/article/details/54608667 原先的分析就删除了,把这两个看明白,
2017-01-18 23:14:26 301
原创 leetcode 103. Binary Tree Zigzag Level Order Traversal
103. Binary Tree Zigzag Level Order Traversal Add to List Question Editorial Solution My Submissions Total Accepted: 84947Total Submissions: 263023Difficulty: Medium
2017-01-17 11:54:04 222
原创 leetcode 325 Maximum Size Subarray Sum Equals k
leetcode 325 Maximum Size Subarray Sum Equals k Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn't one, return 0 instead. Example 1: Given
2017-01-17 10:46:52 314
原创 2017.1.09-2017.1.13面试总结
研二马上就到下学期了,实验室没啥项目,自己的毕设也是刚刚起步,毫无头绪。也许这个时候更应该在实验室安心写代码,做毕设,但是我还是闲不住。基本面试东圃安排在这一周了,面试以来,感慨和个人心得也有一些,记录下来,并考虑在正式找工作前的8个月的学习安排。 一下考虑,均是个人面试经验总结,不同的公司,甚至同一公司同一部门都可能不一样。 周一 美团 美团面试有些偏向算法。最开始是个简单的自我介
2017-01-14 12:53:20 464
转载 数据结构(六)——二叉树 前序、中序、后序、层次遍历及非递归实现 查找、统计个数、比较、求深度的递归实现
原文链接:http://blog.csdn.net/fansongy/article/details/6798278/ 一、基本概念 每个结点最多有两棵子树,左子树和右子树,次序不可以颠倒。 性质: 1、非空二叉树的第n层上至多有2^(n-1)个元素。 2、深度为h的二叉树至多有2^h-1个结点。 满二叉树:所有终端都在同一层次,且非终端
2017-01-10 22:02:02 459
原创 leetcode 100. Same Tree
100. Same Tree Add to List Question Editorial Solution My Submissions Total Accepted: 175177Total Submissions: 387549Difficulty: EasyContributors: Admin Given
2017-01-08 16:59:59 262
原创 leetcode 171. Excel Sheet Column Number
171. Excel Sheet Column Number Add to List Question Editorial Solution My Submissions Total Accepted: 112710Total Submissions: 249314Difficulty: EasyContributors: Ad
2017-01-08 16:52:57 239
原创 leetcode 387. First Unique Character in a String
Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: s = "leetcode" return 0. s = "loveleetcode", return 2. 方法:扫描两
2017-01-08 16:35:46 303
原创 leetcode 237. Delete Node in a Linked List
237. Delete Node in a Linked List Add to List Question Editorial Solution My Submissions Total Accepted: 125969Total Submissions: 277762Difficulty: EasyContributors:
2017-01-08 16:31:03 316
原创 leetcode 404. Sum of Left Leaves
404. Sum of Left Leaves Add to ListQuestionEditorial Solution My SubmissionsTotal Accepted: 29220Total Submissions: 63943Difficulty: EasyContributors: AdminFind the sum of all left leaves in a given b
2017-01-08 16:23:01 320
原创 leetcode 283. Move Zeroes
283. Move Zeroes Add to List Question Editorial Solution My Submissions Total Accepted: 147099Total Submissions: 308184Difficulty: EasyContributors: Admin Giv
2017-01-08 16:14:12 167
原创 leetcode 226. Invert Binary Tree
Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 分析: 递归去交换左右子树的位置 /** * Definition for a binary tree node. * publ
2017-01-08 16:02:53 199
原创 leetcode 258. Add Digits
Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has on
2017-01-08 15:49:13 198
原创 leetcode 104. Maximum Depth of Binary Tree
04. Maximum Depth of Binary Tree Add to List Question Editorial Solution My Submissions Total Accepted: 203899Total Submissions: 401677Difficulty: EasyContributors:
2017-01-08 12:13:59 190
原创 leetcode 136. Single Number
104. Maximum Depth of Binary Tree Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at a ra
2017-01-08 11:39:01 220
原创 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 be the
2017-01-08 11:35:10 239
转载 深入理解Java多态性
在复习Java多态性的时候,无意中看到了这个文章,瞬间感觉有种世界观都被颠覆的感觉。所以特意转来做个分享。 (一)相关类 class A ...{ public String show(D obj)...{ return ("A and D"); } public String sh
2017-01-06 14:32:24 238 1
转载 动态规划之最长递增子序列 最长不重复子串 最长公共子序列
【前言】动态规划:与分治法相似,即通过组合子问题来求解原问题,不同的是分治法是将问题划分为互不相交的子问题,递归求解子问题,再将他们组合起来求出原问题的解。 动态规划则应用于子问题重叠的情况,通常用来求解最优化问题。这类问题可以有很多可行解,每个解都有一个值,我们希望寻找最优值的解。 通常有4个步骤来设计动态规划算法: 1.刻画一个最优解的结构特征。 2.递归地定义最优解的
2017-01-01 18:22:44 449
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人