自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

转载 scala ide + helloworld

http://blog.csdn.net/asongoficeandfire/article/details/21490101 简介 在上一篇文章中,我们阐述了Coursera使用Scala的理由,以及Scala的优缺点。说多不如少练,我们今天就开始练习如何使用Scala编程。...

2015-11-13 12:37:59 1577 0

原创 Sliding Window Maximum

题目: Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see...

2015-10-18 21:02:59 1373 0

原创 Next Permutation

题目: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement ...

2015-10-18 16:22:21 1373 0

原创 Game of Life

题目: According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the Briti...

2015-10-18 13:38:15 2307 0

原创 Median of Two Sorted Arrays

题目: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time compl...

2015-10-13 14:06:41 1389 0

原创 Word Pattern

题目: Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection ...

2015-10-13 13:58:11 1794 0

原创 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...

2015-10-13 13:20:51 1814 0

转载 B树、B-树、B+树、B*树

http://www.cnblogs.com/oldhorse/archive/2009/11/16/1604009.html B树        即二叉搜索树:        1.所有非叶子结点至多拥有两个儿子(Left和Right);        2.所有结点存储...

2015-10-09 10:04:58 918 0

原创 Permutation Sequence

题目: The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, We get the followin...

2015-10-03 20:11:07 862 0

原创 Merge Intervals

题目: Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[1...

2015-10-03 16:27:17 845 0

原创 Insert Interval

题目: Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the interval...

2015-10-03 16:15:56 903 0

原创 Combination Sum III

题目: Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combinatio...

2015-10-03 15:59:47 854 0

原创 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 ...

2015-10-03 15:52:46 1011 0

原创 Restore IP Addresses

题目: Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example: Given "2552...

2015-10-03 15:40:03 841 0

原创 Best Time to Buy and Sell Stock IV

题目: 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. Y...

2015-10-03 15:26:59 1181 0

原创 Best Time to Buy and Sell Stock III

题目: 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. Y...

2015-10-03 15:11:04 838 0

原创 Search for a Range

题目: Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity...

2015-10-03 14:54:08 812 0

原创 Longest Consecutive Sequence

题目: Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, Given [100, 4, 200, 1, 3...

2015-10-03 14:24:50 882 0

原创 Majority Element II

题目: Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1)...

2015-10-03 14:13:35 851 0

原创 Binary Tree Zigzag Level Order Traversal

题目: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the ne...

2015-10-03 13:48:43 721 0

原创 ***Binary Tree Maximum Path Sum

题目: Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to a...

2015-10-03 13:41:49 589 0

原创 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 pa...

2015-10-03 13:31:59 243 0

原创 Convert Sorted List to Binary Search Tree

题目: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 分析: 建树,肯定是借助递归!! 先使用第一个节点; 先...

2015-10-03 13:21:39 202 0

原创 Reverse Linked List II

题目: Reverse a linked list from position m to n. Do it in-place and in one-pass. For example: Given 1->2->3->4->5->NULL, m = 2...

2015-10-03 12:21:36 149 0

原创 Partition List

题目: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should ...

2015-10-03 12:17:24 216 0

原创 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...

2015-10-03 10:45:03 216 0

原创 Repeated DNA Sequences

题目: All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is ...

2015-10-03 10:30:21 225 0

原创 Longest Valid Parentheses

题目: Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parenthe...

2015-10-03 09:53:26 323 0

原创 Multiply Strings

题目: Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large an...

2015-10-02 20:41:26 274 0

原创 Permutations II

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

2015-10-02 18:34:34 230 0

原创 ***N-Queens

题目: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integ...

2015-10-02 17:54:52 235 0

原创 Sudoku Solver

题目: Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells are indicated by the character '.'. You may...

2015-10-02 17:26:39 215 0

原创 Word Search II

题目: Given a 2D board and a list of words from the dictionary, find all words in the board. Each word must be constructed from letters of sequ...

2015-10-02 17:14:24 327 0

原创 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,...

2015-10-02 16:25:12 213 0

原创 Spiral Matrix

题目: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example, Given the followin...

2015-10-02 16:14:32 229 0

原创 Trapping Rain Water

题目: Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap afte...

2015-10-02 16:11:01 215 0

原创 Product of Array Except Self

题目: https://leetcode.com/problems/product-of-array-except-self/ Given an array of n integers where n > 1, nums, return an array output s...

2015-10-02 15:57:24 229 0

原创 Combination Sum II

题目: Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to...

2015-10-02 13:26:40 200 0

原创 Subsets

题目: Given a set of distinct integers, nums, return all possible subsets. Note: Elements in a subset must be in non-descending order.The ...

2015-10-02 12:47:47 229 0

原创 Subsets II

题目: https://leetcode.com/problems/subsets-ii/ Given a collection of integers that might contain duplicates, nums, return all possible subsets. ...

2015-10-02 11:20:37 211 0

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