2015年8月4日

leetcode面试准备:Contains Duplicate I && II

摘要: # 1 题目##**Contains Duplicate I**> Given an array of integers, find if the array contains any duplicates. Your function should return true if any value... 阅读全文

posted @ 2015-08-04 22:24 BYRHuangQiang 阅读(236) 评论(0) 推荐(0) 编辑

leetcode面试准备:Count Complete Tree Nodes

摘要: # 1 题目> Given a complete binary tree, count the number of nodes.In a complete binary tree every level, except possibly the last, is completely filled,... 阅读全文

posted @ 2015-08-04 22:05 BYRHuangQiang 阅读(263) 评论(0) 推荐(0) 编辑

leetcode面试准备: Jump Game II

摘要: # 1 题目> Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents you... 阅读全文

posted @ 2015-08-04 10:02 BYRHuangQiang 阅读(249) 评论(0) 推荐(0) 编辑

leetcode面试准备: Jump Game

摘要: # 1 题目> Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents you... 阅读全文

posted @ 2015-08-04 09:22 BYRHuangQiang 阅读(453) 评论(0) 推荐(0) 编辑

2015年7月30日

LeetCode解题报告:Linked List Cycle && Linked List Cycle II

摘要: LeetCode解题报告:Linked List Cycle && Linked List Cycle II===# 1题目> Linked List CycleGiven a linked list, determine if it has a cycle in it.Follow up:Can ... 阅读全文

posted @ 2015-07-30 11:28 BYRHuangQiang 阅读(437) 评论(0) 推荐(0) 编辑

2015年7月28日

最小栈的实现与优化

摘要: 最小栈====实现一个最小栈,一步一步优化,从额外空间O(N) 到O(1) 。面试官看重代码逻辑。`push`,`pop`,`top`,`getMin`都是O(1)时间。# 1 用一个最小栈来存储最小值## 1.1要点:- 2个栈,data用来存储数据,minValue用来存储最小值。- `pus... 阅读全文

posted @ 2015-07-28 11:49 BYRHuangQiang 阅读(4303) 评论(0) 推荐(0) 编辑

2015年7月23日

面试:归并排序

摘要: 面试:归并排序===归并排序算法,时间复杂度`O(NlogN)`,空间复杂度`O(N)`。分治法(Divide and Conquer)的一个非常典型的应用。#1.如何将2个有序数列合并简单,只要比较2个数列的第一个数,谁小就先取谁,取了后就在对应数列中删除这个数。然后再进行比较,如果有数列为空,那... 阅读全文

posted @ 2015-07-23 14:47 BYRHuangQiang 阅读(507) 评论(0) 推荐(0) 编辑

2015年7月10日

leetcode面试准备:Decode Ways

摘要: # 1 题目A message containing letters from A-Z is being encoded to numbers using the following mapping:```'A' -> 1'B' -> 2...'Z' -> 26```Given an encoded... 阅读全文

posted @ 2015-07-10 18:07 BYRHuangQiang 阅读(277) 评论(0) 推荐(0) 编辑

leetcode面试准备:Multiply Strings

摘要: # 1 题目> Given two numbers represented as strings, return multiplication of the numbers as a string.**Note:** The numbers can be arbitrarily large and ... 阅读全文

posted @ 2015-07-10 16:49 BYRHuangQiang 阅读(305) 评论(0) 推荐(0) 编辑

2015年7月9日

leetcode面试准备:Summary Ranges

摘要: # 1 题目> Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"]... 阅读全文

posted @ 2015-07-09 14:22 BYRHuangQiang 阅读(241) 评论(0) 推荐(0) 编辑

导航