关闭

CODE 17: Populating Next Right Pointers in Each Node

Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its next right node. If t...
阅读(484) 评论(0)

CODE 15: Pascal's Triangle

Given 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] ] My Code: public...
阅读(522) 评论(0)

CODE 9: Binary Tree Maximum Path Sum

Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. For example: Given the below binary tree, 1 / \ 2 3 Return 6. ...
阅读(639) 评论(0)

CODE 2: 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"],...
阅读(564) 评论(0)

CODE 14: Pascal's Triangle II

Given 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) extra space? public Ar...
阅读(437) 评论(0)

CODE 13: 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],...
阅读(412) 评论(0)

CODE 10: 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. You may complete at most two transactions. Note: You may no...
阅读(714) 评论(0)

CODE 11: Best Time to Buy and Sell Stock II

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. You may complete as many transactions as you like (ie, buy on...
阅读(747) 评论(0)

CODE 12: Best Time to Buy and Sell Stock

Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),...
阅读(646) 评论(0)

CODE 8: 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 pa...
阅读(545) 评论(0)

CODE 7: Word Ladder

Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that: Only one letter can be changed at a time Each intermediate word...
阅读(499) 评论(0)

CODE 5: 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, 2], The longest consecutive elements sequence is [1, 2, 3,...
阅读(382) 评论(0)

CODE 4: 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 sum...
阅读(539) 评论(0)

CODE 3: Surrounded Regions

Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in that surrounded region . For example, X X X X X O O X X X O...
阅读(496) 评论(1)

CODE 1: Palindrome Partitioning II

Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partitioning of s. For example, given s = "aab", Return 1 s...
阅读(422) 评论(1)

人生就是不停的战斗————九把刀北大演讲

时间:2011年11月5日 地点:北京大学2号楼205 主题:人生就是不停的战斗 手打组:中财刘铮,魏文婷 请尊重手打组作品,转载勿删除手打组。   非常非常开心能够来北京大学演讲,我能表现出的最大的诚意就是,今天的演讲将是原汁原味非常忠于台湾版本的“人生就是不停的战斗”,还加了一段目前在台湾演讲一共讲了不到三次的“神的微笑”。希望我们今天晚上会有非常热血的两个小时。 但是“人生就是...
阅读(1768) 评论(0)

python 串口测试工具中 py2exe的使用

python 串口测试工具中 py2exe的使用 from distutils.core import setup import py2exe import sys, os sys.argv.append('py2exe') origIsSystemDLL = py2exe.build_exe.isSystemDLL def isSystemDLL(pathname): if os...
阅读(974) 评论(0)

python串口通信模块——pySerial

pySerial Overview This module encapsulates the access for the serial port. It provides backends for Python running on Windows, Linux, BSD (possibly any POSIX compliant system), Jython and IronPython...
阅读(1681) 评论(0)

在python文件中集成图片

方法一: http://leo108.com/pid-938.asp 使用base64方式编解码。 核心代码如下: 1.将图片文件编码为base64字符串: import base64 #导入base64库 f = open(r'/home/1.ico','rb') #用二进制方式打开图片文件 str = base64.b64encode(...
阅读(377) 评论(0)
199条 共10页首页 上一页 ... 6 7 8 9 10 ...
    个人资料
    • 访问:99480次
    • 积分:2706
    • 等级:
    • 排名:第13836名
    • 原创:178篇
    • 转载:21篇
    • 译文:0篇
    • 评论:9条
    文章分类
    最新评论