2015年11月3日
摘要: 题目:Given an array of numbersnums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two element... 阅读全文
posted @ 2015-11-03 15:07 已停更 阅读(173) 评论(0) 推荐(0)
摘要: 题目:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complet... 阅读全文
posted @ 2015-11-03 13:55 已停更 阅读(153) 评论(0) 推荐(0)
摘要: 题目: ay 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 com 阅读全文
posted @ 2015-11-03 13:54 已停更 阅读(170) 评论(0) 推荐(0)
摘要: 题目:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complet... 阅读全文
posted @ 2015-11-03 13:39 已停更 阅读(146) 评论(0) 推荐(0)
摘要: 题目:Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction ... 阅读全文
posted @ 2015-11-03 08:42 已停更 阅读(196) 评论(0) 推荐(0)
  2015年11月2日
摘要: 题目:Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1解析: 1 /** 2 * Definition for a bina... 阅读全文
posted @ 2015-11-02 21:09 已停更 阅读(211) 评论(0) 推荐(0)
摘要: 1. 使用os.system("cmd")这是最简单的一种方法,特点是执行的时候程序会打出cmd在linux上执行的信息。使用前需要import os。os.system("ls") 2. 使用Popen模块产生新的process现在大部分人都喜欢使用Popen。Popen方法不会打印出cmd在l... 阅读全文
posted @ 2015-11-02 16:27 已停更 阅读(12954) 评论(0) 推荐(1)
摘要: 题目:Given an arraynums, write a function to move all0's to the end of it while maintaining the relative order of the non-zero elements.For example, giv... 阅读全文
posted @ 2015-11-02 14:37 已停更 阅读(212) 评论(0) 推荐(0)
摘要: 题目:Given 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... 阅读全文
posted @ 2015-11-02 11:12 已停更 阅读(252) 评论(0) 推荐(0)
摘要: 题目:Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is1 -> 2 -> 3 ... 阅读全文
posted @ 2015-11-02 09:36 已停更 阅读(206) 评论(0) 推荐(0)