11 2015 档案

摘要:题目解析:(链接)Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next lev... 阅读全文
posted @ 2015-11-30 14:42 skycore 阅读(144) 评论(0) 推荐(0)
摘要:题目描述:(链接)Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root... 阅读全文
posted @ 2015-11-29 14:24 skycore 阅读(150) 评论(0) 推荐(0)
摘要:题目描述:(链接)Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary t... 阅读全文
posted @ 2015-11-29 14:17 skycore 阅读(155) 评论(0) 推荐(0)
摘要:题目描述:(链接)Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[... 阅读全文
posted @ 2015-11-22 17:21 skycore 阅读(149) 评论(0) 推荐(0)
摘要:题目描述:(链接)Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,... 阅读全文
posted @ 2015-11-22 16:55 skycore 阅读(200) 评论(0) 推荐(0)
摘要:题目描述:(链接)Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1... 阅读全文
posted @ 2015-11-22 16:41 skycore 阅读(141) 评论(0) 推荐(0)
摘要:题目解析:(链接)Givennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in t... 阅读全文
posted @ 2015-11-22 16:17 skycore 阅读(128) 评论(0) 推荐(0)
摘要:题目描述:(链接)Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is ... 阅读全文
posted @ 2015-11-20 11:45 skycore 阅读(159) 评论(0) 推荐(0)
摘要:题目描述:(链接)Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", th... 阅读全文
posted @ 2015-11-17 17:54 skycore 阅读(152) 评论(0) 推荐(0)
摘要:matplotlib是python最著名的绘图库,它提供了一整套和MATLAB类似的绘图函数集。一. 快速绘图1. 使用pyplot模块绘图pyplot模块提供了快速绘制二维图表的API,例子: 1 # -*- coding: utf-8 -*- 2 """ 3 绘制简单的曲线。 4 """ 5 i... 阅读全文
posted @ 2015-11-17 16:45 skycore 阅读(374) 评论(0) 推荐(0)
摘要:题目描述:(链接)Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"click to show c... 阅读全文
posted @ 2015-11-17 14:43 skycore 阅读(155) 评论(0) 推荐(0)
摘要:题目描述:(链接)Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurren... 阅读全文
posted @ 2015-11-14 22:36 skycore 阅读(182) 评论(0) 推荐(0)
摘要:原文地址: http://www.cnblogs.com/archimedes/p/mapreduce-principle.html简单解释 MapReduce 算法一个有趣的例子你想数出一摞牌中有多少张黑桃。直观方式是一张一张检查并且数出有多少张是黑桃?MapReduce方法则是:给在座的所有玩家... 阅读全文
posted @ 2015-11-14 22:14 skycore 阅读(260) 评论(0) 推荐(0)
摘要:题目描述:(链接)Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.解题思路: 1 class Solution { 2 public: ... 阅读全文
posted @ 2015-11-12 18:28 skycore 阅读(172) 评论(0) 推荐(0)
摘要:题目描述:(链接)Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.解题思路: 1 class Solution { 2 public: ... 阅读全文
posted @ 2015-11-12 18:15 skycore 阅读(134) 评论(0) 推荐(0)
摘要:题目描述:(链接)Write a function to find the longest common prefix string amongst an array of strings.解题思路:两两比较。 1 class Solution { 2 public: 3 string lo... 阅读全文
posted @ 2015-11-12 10:22 skycore 阅读(145) 评论(0) 推荐(0)
摘要:题目描述:(链接)Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the... 阅读全文
posted @ 2015-11-12 10:09 skycore 阅读(154) 评论(0) 推荐(0)
摘要:题目描述:(链接)Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:You may assume thatnums1has enough space (size that... 阅读全文
posted @ 2015-11-12 09:55 skycore 阅读(119) 评论(0) 推荐(0)
摘要:题目描述:(链接)The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read ... 阅读全文
posted @ 2015-11-11 22:42 skycore 阅读(172) 评论(0) 推荐(0)
摘要:Numpy:numpy提供两种基本的对象:ndarray和ufunc,ndarray是存储单一数据类型的多为数组,ufunc是能够对数组进行操作的函数。1.ndarray对象创建数组:a = numpy.array([1, 2, 3, 4])b = np.array([[1, 2, 3, 4], [... 阅读全文
posted @ 2015-11-10 14:49 skycore 阅读(463) 评论(0) 推荐(1)
摘要:题目描述:(链接)Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a ca... 阅读全文
posted @ 2015-11-09 23:27 skycore 阅读(173) 评论(0) 推荐(0)
摘要:题目描述:(链接)Remove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,val= 6Return:1 --> 2... 阅读全文
posted @ 2015-11-08 22:23 skycore 阅读(128) 评论(0) 推荐(0)
摘要:题目描述:(链接)Given a singly linked list, determine if it is a palindrome.解题思路:使用快慢指针,找到链表的中心点,然后逆序后一半链表,最后再一一比较! 1 /** 2 * Definition for singly-linked l... 阅读全文
posted @ 2015-11-07 23:54 skycore 阅读(173) 评论(0) 推荐(0)
摘要:题目描述:(链接)Determine whether an integer is a palindrome. Do this without extra space.解题思路:分离出首位,末位,分别比较! 1 class Solution { 2 public: 3 bool isPalin... 阅读全文
posted @ 2015-11-07 23:12 skycore 阅读(189) 评论(0) 推荐(0)
摘要:题目描述:(链接)Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.... 阅读全文
posted @ 2015-11-05 23:22 skycore 阅读(126) 评论(0) 推荐(0)
摘要:题目描述:(链接)Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be i... 阅读全文
posted @ 2015-11-05 22:59 skycore 阅读(160) 评论(0) 推荐(0)
摘要:题目描述:(链接)Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last... 阅读全文
posted @ 2015-11-04 16:05 skycore 阅读(144) 评论(0) 推荐(0)
摘要:题目描述:(链接)Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.解题思路: 1 class Sol... 阅读全文
posted @ 2015-11-03 16:27 skycore 阅读(132) 评论(0) 推荐(0)
摘要:题目描述: (链接)GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [... 阅读全文
posted @ 2015-11-03 15:52 skycore 阅读(133) 评论(0) 推荐(0)
摘要:题目描述:(链接)Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sort... 阅读全文
posted @ 2015-11-02 23:34 skycore 阅读(151) 评论(0) 推荐(0)
摘要:题目描述:(链接)Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Y... 阅读全文
posted @ 2015-11-01 18:13 skycore 阅读(112) 评论(0) 推荐(0)