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)
摘要: 题目:Given 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... 阅读全文
posted @ 2015-11-02 09:17 已停更 阅读(160) 评论(0) 推荐(0)
摘要: 题目:Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complex... 阅读全文
posted @ 2015-11-02 08:41 已停更 阅读(175) 评论(0) 推荐(0)