自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(93)
  • 资源 (1)
  • 收藏
  • 关注

原创 Search 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 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the array retur

2015-04-11 21:51:39 333

原创 ftrl学习之路

统计学习方法有三要素:模型、策略、算法,下面就这三要素分别介绍以引出ftrl(自己学习琢磨的,如有错误,感谢您的指出!)算法。1.       模型首先介绍几个定义。定义1 回归。所谓回归,就是根据已有的样本来估计待定的参数。举例(来自网络):房价(Y)与面积(x1)、容积率(x2)、区域均价(x3)、小区绿化程度(x4)、距离地铁(x5)的关系。

2015-01-26 18:45:16 2140

原创 原型链

前言虽然接触了很久的javascript,但是总感觉自己对js的prototype理解不到位。刚好今天在公司的所有活都做完了,就抽空把自己整理的笔记记录下来。首先需要了解js的几个概念:js没有类这回事。虽然它保留了class的关键字,但是至今并未派上用场。在js中,所有的东西都是对象,包括函数,因此函数可以为变量赋值。整个原型链就是一个链表,prototype,_prot

2014-10-27 15:53:37 423

原创 求数组次数出现一半或一半以上的次数的数

如果不考虑时间复杂度的话,

2014-10-22 09:45:35 1058

原创 Valid Sudoku

Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character '.'.A partially fille

2014-10-21 20:53:00 337

原创 智力题系列一

1.

2014-10-21 14:17:27 621

原创 数据结构之字典树

又称单词查找树,Trie树,是一种树形结构,是一种哈希树的变种。典型应用是用于统计,排序和保存大量的字符串(但不仅限于字符串),所以经常被搜索引擎系统用于文本词频统计。它的优点是:利用字符串的公共前缀来节约存储空间,最大限度地减少无谓的字符串比较,查询效率比哈希表高。   字典树与字典很相似,当你要查一个单词是不是在字典树中,首先看单词的第一个字母是

2014-10-19 15:35:35 494

原创 排序之堆排序

排序中的堆排序一直没去看,没搞

2014-10-19 00:44:16 489

原创 多态的相关总结

多态的概念

2014-10-12 00:01:55 471

原创 读取文件夹下的所有文件

最近做个项目需要

2014-10-10 10:58:30 330

原创 Word Ladder II

Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that:Only one letter can be changed at a timeEach intermediate word must exi

2014-09-30 23:39:22 523

原创 word break II

Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such possible sentences.For example, givens = "cats

2014-09-28 21:03:39 387

原创 word break

Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict = ["leet",

2014-09-28 14:04:20 366

原创 Recover Binary Search Tree

Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is pretty straight forward. Could you devise a

2014-09-26 11:20:41 312

原创 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 [ ["aa","b"],

2014-09-25 00:24:45 315

原创 数据库多表连接

在开始复习数据库的多表连接之前,先来看一个例子

2014-09-24 21:53:51 478

原创 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 next level and alternate between).For example:Given binary

2014-09-24 21:00:10 350

原创 Triangle

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3,4], [6,

2014-09-24 17:51:55 383

原创 Max Points on a Line

Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.思路:

2014-09-24 12:50:38 392

原创 Longest Valid Parentheses

Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is "()", wh

2014-09-22 16:37:29 374

原创 Evaluate Reverse Polish Notation

Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1", "+",

2014-09-22 12:07:10 337

原创 Spiral Matrix II

Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example,Given n = 3,You should return the following matrix:[ [ 1, 2, 3 ], [ 8, 9, 4 ], [

2014-09-22 11:15:01 328

原创 Simplify Path

Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c"click to show corner cases.Corner Cases:Did you co

2014-09-22 10:20:46 365

原创 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 vertically n

2014-09-21 23:50:45 337

原创 Path Sum II

Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum = 22, 5 / \

2014-09-21 15:41:20 476

原创 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 must be in the order of O(log n).If the target is not found in t

2014-09-21 14:30:47 378

原创 Binary Tree Level Order Traversal II

Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree {3,9,20,#,#,15,7},

2014-09-20 23:12:57 337

原创 N-Queens II

Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.si

2014-09-20 22:48:57 340

原创 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 integer n, return all distinct solutions to the n-queens puzzle.Eac

2014-09-20 22:31:20 302

原创 Restore IP Addresses

Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given "25525511135",return ["255.255.11.135", "255.255.111.35"]. (Order do

2014-09-20 20:55:13 343

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

2014-09-20 19:25:06 254

原创 Letter Combinations of a Phone Number

Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.Input:Digit string

2014-09-20 18:57:07 332

原创 Generate Parentheses

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()()

2014-09-20 17:10:09 345

原创 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 T.Each number in C may only be used once in the combina

2014-09-20 16:52:22 290

原创 Combination Sum

Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C unlimited numb

2014-09-20 16:13:34 300

原创 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 following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]

2014-09-19 16:49:44 294

原创 Symmetric Tree

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \3 4 4 3But the f

2014-09-19 15:59:30 340

原创 Next Permutation

Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible o

2014-09-18 15:32:15 325

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

2014-09-18 15:04:07 266

原创 Palindrome Number

Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinking of convertin

2014-09-18 12:39:23 294

svg开发实践

比较全面的svg资料,中间可能有些不是很清晰

2013-12-02

空空如也

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

TA关注的人

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