- 博客(52)
- 资源 (23)
- 收藏
- 关注
原创 用两个栈实现队列的功能
用两个栈实现队列的功能思路如下:(1)将设有两个空栈A,B;A负责入队,B负责出队。(2)入队时,将元素压入栈A(3)出队时,若B栈为空,将A中的元素全部出栈,并压入B中,然后B的栈顶元素出栈。若B栈不为空,直接将B的栈顶元素出栈。转载请注明:康瑞的部落 » 用两个栈实现队列的功能
2015-05-31 12:34:03 737
原创 [LeetCode] Contains Duplicate II
Contains Duplicate II Given an array of integers and an integer k, return true if and only if there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference b
2015-05-30 19:26:32 1780
原创 [LeetCode] Reorder List
Reorder ListGiven 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' values.For example,Given {1,2,3,
2015-05-28 22:19:35 701
原创 [LeetCode] Binary Tree Preorder Traversal (非递归的先序遍历)
Binary Tree Preorder Traversal Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3re
2015-05-28 17:42:50 782
原创 [LeetCode] Insertion Sort List
Insertion Sort ListSort a linked list using insertion sort.解题思路:类似于插入排序法。与数组的插入排序法不同的是,链表的插入排序扫描顺序是从左往右扫描,找到第一个大于指定元素的节点N,然后将之插在N节点前面。今天状态非常不好,这个题目都NG了好几遍。。。/** * Definition for singly-li
2015-05-28 17:06:32 985
原创 [LeetCode] Maximum Subarray
Maximum SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4],the contiguous
2015-05-27 17:02:55 667
原创 [LeetCode] Jump Game
Jump Game Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that positi
2015-05-27 15:34:46 665
原创 [LeetCode] Pow(x, n)
Pow(x, n) Implement pow(x, n).解题思路:这里n是整数,注意可能是负数,因此需要先将其转化成正数。若直接用循环的方法做,会产生超时错误。我们可以这么做。比如求2^6,我们需要求2^(2*3)=4^3=4*4^2,这样时间复杂度为O(logn)。注意几个特殊的情况,当n==1时,返回x本身,当n==0时,返回1,当n为偶数时,返回myPow(x*x
2015-05-26 23:45:37 1282
原创 [LeetCode] Anagrams
Anagrams Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.解题思路:anagrams(变位字)是指对于两个单词来说,长度相同,且构成的字符除了顺序可以不同外,个数都相同。如cinem
2015-05-26 16:28:39 669
原创 [LeetCode] Subsets
SubsetsGiven a set of distinct integers, nums, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets
2015-05-26 15:11:49 730
原创 [LeetCode] Kth Largest Element in an Array
Kth Largest Element in an ArrayFind 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,Give
2015-05-25 20:25:04 2546
原创 [LeetCode] Combination Sum III
Combination Sum IIIFind 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 combination should be a unique set of numbers
2015-05-25 17:18:39 2251
原创 [LeetCode] Contains Duplicate
Contains DuplicateGiven an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return fal
2015-05-25 16:19:39 3504
原创 [LeetCode] Rotate Image
Rotate ImageYou are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?解题思路:题目要求原地算法。假设坐标轴如上所示。顺时针
2015-05-22 23:35:51 842
原创 [LeetCode] House Robber II
House Robber IINote: This is an extension of House Robber.After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much
2015-05-22 22:50:49 1577
原创 程序远表白网,对Ta Say Love
历经两周构思与取材,两天编写代码,程序远表白网V1.0版已经上线啦。网址:http://www.kangry.net/love/。整合了当前网站其他人做的一些模板,修改了一些Bug。目前尚不支持手机版的(手机版样式可能不对)建议用Chorme、Firefox、IE9+等高级浏览器打开。祝你表白成功!你有多久没有心动过?有多久没有对一个男/女孩说“
2015-05-20 11:18:21 1934
原创 JS获得当前时间,并格式化
function getNowFormatDate() { var date = new Date(); var year = date.getFullYear(); var month = date.getMonth() + 1; var d = date.getDate(); var hour = date.getHours(); v
2015-05-19 11:24:13 1997
原创 [LeetCode] Merge Sorted Array
Merge Sorted ArrayGiven two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater or equal
2015-05-17 17:22:44 844
原创 [LeetCode] Same Tree
Same TreeGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value
2015-05-17 16:57:33 815
原创 [LeetCode] Symmetric Tree
Symmetric TreeGiven 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
2015-05-17 16:50:36 935
原创 [LeetCode] Add and Search Word - Data structure design
Add and Search Word - Data structure designDesign a data structure that supports the following two operations:void addWord(word)bool search(word)search(word) can search a literal word or
2015-05-17 16:16:52 1464
原创 [LeetCode] Binary Tree Level Order Traversal
Binary Tree Level Order Traversal Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree {3,9,
2015-05-16 20:09:06 677
原创 [LeetCode] Maximum Depth of Binary Tree
Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
2015-05-16 19:36:56 839
原创 [LeetCode] Course Schedule II
Course Schedule IIThere 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
2015-05-16 19:31:59 1359
原创 C# JavaScriptSerializer报错,json数据太长
ASP.NET平台中,用JavaScriptSerializer将返回的数据序列化,若返回的数据非常大,则可能会报如下错误:Exception information: Exception type: InvalidOperationException Exception message: Error during serialization or deserialization usin
2015-05-13 15:32:24 4549 1
原创 [LeetCode] Permutations II
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
2015-05-13 13:34:37 604
原创 [LeetCode] Permutations
Permutations Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2
2015-05-13 13:03:12 788
原创 [LeetCode] Balanced Binary Tree
Balanced Binary TreeGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees
2015-05-12 15:22:51 724
原创 [LeetCode] Minimum Depth of Binary Tree
Minimum Depth of Binary TreeGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.
2015-05-12 14:58:18 666
原创 [LeetCode] Pascal's Triangle II
Pascal's Triangle IIGiven an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm to use only O(k) ex
2015-05-12 14:40:27 786
原创 [LeetCode] Minimum Size Subarray Sum
Minimum Size Subarray Sum Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn't one, return 0 instead.
2015-05-12 14:19:10 1711
原创 [LeetCode] Implement Trie (Prefix Tree)
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.解题思路:前缀树。由于值设定为在a-
2015-05-11 14:32:57 1502
原创 Azure云平台学习之路(三)——Cloud Services
1、什么是云服务?能够部署高度可用的且可无限缩放的应用程序和API。简而言之,就是你写的CMD程序按照一定的框架进行少量修改就能运行在Azure云平台上。2、Azure云服务有什么特点?(1)专注应用程序而不是硬件,PaaS的一种。(2)支持多种框架和语言。(3)集成了运行状况监视和负载平衡。(4)自动缩放
2015-05-08 22:27:33 3111
原创 Azure云平台学习之路(二)——SQL Database
1、什么是SQL Database?托管关系数据库,数据库即服务,IaaS的一种。2、有哪些特点?(1)为SaaS应用提供可扩展的数据存储服务。(2)易于操作大量的数据库。稍后介绍几种操作数据库的方法。(3)性能更高,稳定性更好。基于Azure平台,高性能可扩展;多地区容灾备份。(4)接近0维护,无需维护其他硬件设备。
2015-05-08 11:00:01 1464
原创 Azure云平台学习之路(一)——Azure简介
1、什么是Azure?Microsoft Azure是由微软所发展的一套云计算操作系统(云平台),提供各种优质的服务:计算、存储、数据、网络和应用程序。Azure意为天蓝色、蔚蓝色。2、Azure特点?(1)平台即服务(Platform as a Service,PaaS)+ 基础架构即服务(Infrastructure as a Service,IaaS)。
2015-05-08 10:58:28 4789
原创 [LeetCode] Valid Palindrome
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" is not a
2015-05-07 14:57:02 682
原创 [LeetCode] Pascal's Triangle
Pascal's TriangleGiven numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]解题思
2015-05-07 14:43:02 861
原创 [LeetCode] Remove Duplicates from Sorted List
Remove Duplicates from Sorted ListGiven a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, re
2015-05-07 14:30:35 652
原创 [LeetCode] Climbing Stairs
You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?解题思路:动态规划,类似于斐波那契数列。X X X.
2015-05-07 14:20:30 622
原创 [LeetCode] 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
2015-05-07 14:00:55 2100
ueditor for bos
2015-10-22
jquery.gantt,js甘特图
2014-12-30
c#汉字转拼音dll
2014-09-21
zend safeguard 加密php 破解版
2014-03-12
ueditor上传到bcs中
2014-01-05
mysql-connector for C/C++
2013-10-24
coreseek4.1 支持多音字拼音索引第三版
2013-09-19
coreseek4.1 支持多音字拼音索引 win64
2013-09-03
coreseek4.1 支持拼音索引 win32
2013-09-01
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人