自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(153)
  • 资源 (7)
  • 问答 (1)
  • 收藏
  • 关注

原创 Math Summary

"1 + 1" = 2" 2-1 + 2 " = 3"(1+(4+5+2)-3)+(6+8)" = 23numbers could be more than one digit!!!

2016-05-25 07:42:28 194

原创 LInkedList

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2->3->3->4->4->5, return 1->2->5.Given 1->

2016-05-18 07:28:36 276

原创 Hash Table

How to Iterate Over a Map in Java

2016-05-12 06:17:47 216

原创 Binary Search Summary

Find a place to insert an element[1, 3, 5, 7, 9]insert 4public int find(int start, int end, int key, int[] sums){ while(start <= end){ int mid = (start + end) / 2;

2016-05-08 06:49:30 233

原创 Array Summary

The order of elements can be changed. It doesn't matter what you leave beyond the new length.You can just copy the elements instead of swapping.

2016-05-06 04:00:31 203

原创 220. Contains Duplicate III

Given an array of integers, find out whether there are two distinct indices i and j in the array such that the difference between nums[i] and nums[j] is at most t and the difference between i an

2016-04-25 05:42:16 353

原创 307. Range Sum Query - Mutable

Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.The update(i, val) function modifies nums by updating the element at index i to val.Examp

2016-04-23 11:57:48 187

原创 284. Peeking Iterator

Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the peek() operation -- it essentially peek() at the element that will be

2016-04-23 05:04:20 343

原创 130. Surrounded Regions

Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in that surrounded region.For example,X X X XX O O X

2016-04-23 03:45:31 191

原创 200. Number of Islands

Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assu

2016-04-22 14:38:06 209

原创 210. Course Schedule II

There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as

2016-04-22 14:23:13 205

原创 207. Course Schedule

There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as

2016-04-22 02:58:27 165

原创 133. Clone Graph

Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.Solution 1 BFS//BFS public UndirectedGraphNode cloneGraph(UndirectedGraphNode node) { if(n

2016-04-20 00:48:12 188

原创 129. Sum Root to Leaf Numbers

Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which represents the number 123.Find the total sum

2016-04-19 02:51:41 156

原创 199. Binary Tree Right Side View

Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.For example:Given the following binary tree, 1

2016-04-19 02:09:50 163

原创 114. Flatten Binary Tree to Linked List

Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened tree should look like: 1

2016-04-18 02:25:26 234

原创 98. Validate Binary Search Tree

Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys less than the node's key.Th

2016-04-17 03:48:29 242

原创 116. Populating Next Right Pointers in Each Node

Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointer to point to its next right node.

2016-04-16 12:16:25 238

原创 201. Bitwise AND of Numbers Range

Given a range [m, n] where 0 For example, given the range [5, 7], you should return 4.Solution1https://yq.aliyun.com/articles/3512// https://yq.aliyun.com/articles/3512 public int r

2016-04-16 11:14:32 167

原创 179. Largest Number

Given a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.Note: The result may be ve

2016-04-16 02:17:49 170

原创 134. Gas Station

There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to

2016-04-14 08:01:42 124

原创 173. Binary Search Tree Iterator

Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Calling next() will return the next smallest number in the BST.Note: next()

2016-04-14 07:52:27 155

原创 211. Add and Search Word - Data structure design

Design a data structure that supports the following two operations:void addWord(word)bool search(word)search(word) can search a literal word or a regular expression string containing only lett

2016-04-12 14:22:31 159

原创 208. Implement Trie (Prefix Tree)

Implement a trie with insert, search, and startsWith methods.Note:You may assume that all inputs are consist of lowercase letters a-z.class TrieNode { // Initialize your data structure

2016-04-12 14:07:49 152

原创 77. Combinations

Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.For example,If n = 4 and k = 2, a solution is:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4],]

2016-04-11 14:03:00 158

原创 89. Gray Code

The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequence of

2016-04-11 12:31:40 155

原创 131. Palindrome Partitioning

Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example, given s = "aab",Return [ [

2016-04-11 07:14:18 154

原创 47. Permutations II

Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique permutations:[1,1,2], [1,2,1], and [2,1

2016-04-10 08:41:53 195

原创 309. Best Time to Buy and Sell Stock with Cooldown

Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy on

2016-04-09 02:09:01 127

原创 221. Maximal Square

Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the following matrix:1 0 1 0 01 0 1 1 11 1 1 1 11 0 0 1 0

2016-04-08 03:55:58 133

原创 95. Unique Binary Search Trees II

Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.For example,Given n = 3, your program should return all 5 unique BST's shown below. 1 3

2016-04-08 02:15:09 181

原创 96. Unique Binary Search Trees

Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's. 1 3 3 2 1 \

2016-04-07 03:00:21 130

原创 222. Count Complete Tree Nodes

Given a complete binary tree, count the number of nodes.Definition of a complete binary tree from Wikipedia:In a complete binary tree every level, except possibly the last, is completely filled,

2016-04-07 01:48:34 153

原创 230. Kth Smallest Element in a BST

Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements.Follow up:What if the

2016-04-06 04:57:18 181

原创 300. Longest Increasing Subsequence

Given an unsorted array of integers, find the length of longest increasing subsequence.For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest increasing subsequence is [2, 3, 7, 101], ther

2016-04-06 02:03:41 195

原创 241. Different Ways to Add Parentheses

Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +,- and *.Example 1I

2016-04-05 02:11:12 149

原创 215. Kth Largest Element in an Array

Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example,Given [3,2,1,5,6,4] and k = 2, return 5.

2016-04-04 10:59:52 153

转载 Ten sort algorithms in interviews

http://www.admin10000.com/document/7042.html

2016-04-04 10:58:02 172

原创 240. Search a 2D Matrix II

Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted in ascending from left to right.Integers in

2016-04-04 04:35:34 186

原创 91. Decode Ways

A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the total nu

2016-04-02 05:42:36 181

spring注解完整版

spring注解完整版

2013-08-04

JSTL详解--jsp页面编写规范详解

JSTL详解--jsp页面编写规范详解

2013-08-04

CSS禅意花园

卖的很好的一本书 想学习网页制作的人一定要看的

2013-07-08

jQueryAPI_1.7.1_CN.chm

jQueryAPI_1.7.1_CN.chm

2013-07-08

ThinkingInJava第四版

清晰版ThinkingInJava第四版

2013-05-26

HeadFirstJava源码

HeadFirstJava书上的源码 对新手很有用

2013-05-24

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

TA关注的人

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