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...
阅读全文
摘要:题目描述:(链接)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...
阅读全文
摘要:题目描述:(链接)Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary t...
阅读全文
摘要:题目描述:(链接)Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[...
阅读全文
摘要:题目描述:(链接)Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,...
阅读全文
摘要:题目描述:(链接)Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1...
阅读全文
摘要:题目解析:(链接)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...
阅读全文
摘要:题目描述:(链接)Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is ...
阅读全文
摘要:题目描述:(链接)Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", th...
阅读全文
摘要:matplotlib是python最著名的绘图库,它提供了一整套和MATLAB类似的绘图函数集。一. 快速绘图1. 使用pyplot模块绘图pyplot模块提供了快速绘制二维图表的API,例子: 1 # -*- coding: utf-8 -*- 2 """ 3 绘制简单的曲线。 4 """ 5 i...
阅读全文
摘要:题目描述:(链接)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...
阅读全文
摘要:题目描述:(链接)Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurren...
阅读全文
摘要:原文地址: http://www.cnblogs.com/archimedes/p/mapreduce-principle.html简单解释 MapReduce 算法一个有趣的例子你想数出一摞牌中有多少张黑桃。直观方式是一张一张检查并且数出有多少张是黑桃?MapReduce方法则是:给在座的所有玩家...
阅读全文
摘要:题目描述:(链接)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: ...
阅读全文
摘要:题目描述:(链接)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: ...
阅读全文
摘要:题目描述:(链接)Write a function to find the longest common prefix string amongst an array of strings.解题思路:两两比较。 1 class Solution { 2 public: 3 string lo...
阅读全文
摘要:题目描述:(链接)Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the...
阅读全文
摘要:题目描述:(链接)Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:You may assume thatnums1has enough space (size that...
阅读全文
摘要:题目描述:(链接)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 ...
阅读全文
摘要:Numpy:numpy提供两种基本的对象:ndarray和ufunc,ndarray是存储单一数据类型的多为数组,ufunc是能够对数组进行操作的函数。1.ndarray对象创建数组:a = numpy.array([1, 2, 3, 4])b = np.array([[1, 2, 3, 4], [...
阅读全文
摘要:题目描述:(链接)Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a ca...
阅读全文
摘要:题目描述:(链接)Remove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,val= 6Return:1 --> 2...
阅读全文
摘要:题目描述:(链接)Given a singly linked list, determine if it is a palindrome.解题思路:使用快慢指针,找到链表的中心点,然后逆序后一半链表,最后再一一比较! 1 /** 2 * Definition for singly-linked l...
阅读全文
摘要:题目描述:(链接)Determine whether an integer is a palindrome. Do this without extra space.解题思路:分离出首位,末位,分别比较! 1 class Solution { 2 public: 3 bool isPalin...
阅读全文
摘要:题目描述:(链接)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....
阅读全文
摘要:题目描述:(链接)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...
阅读全文
摘要:题目描述:(链接)Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last...
阅读全文
摘要:题目描述:(链接)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...
阅读全文
摘要:题目描述: (链接)GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [...
阅读全文
摘要:题目描述:(链接)Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sort...
阅读全文
摘要:题目描述:(链接)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...
阅读全文

浙公网安备 33010602011771号