2016年4月20日

Leetcode 171 Excel Sheet Column Number python

摘要: 题目: Given a column title as appear in an Excel sheet, return its corresponding column number. For example: 阅读全文

posted @ 2016-04-20 12:18 def_sysu 阅读(194) 评论(0) 推荐(0)

2016年4月17日

Leetcode 242 Valid Anagram pytyhon

摘要: 题目: Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = "anagram", t = "nagaram", return true.s = "rat", 阅读全文

posted @ 2016-04-17 00:22 def_sysu 阅读(154) 评论(0) 推荐(0)

2016年4月16日

Leetcode 100 Same Tree python

摘要: 题目: 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 identic 阅读全文

posted @ 2016-04-16 14:19 def_sysu 阅读(344) 评论(0) 推荐(0)

leetcode 237 Delete Node in a Linked List python

摘要: 题目: 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 is 1 -> 2 -> 阅读全文

posted @ 2016-04-16 14:10 def_sysu 阅读(429) 评论(0) 推荐(0)

Leetcode 283 Move Zeroes python

摘要: 题目: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, 阅读全文

posted @ 2016-04-16 14:01 def_sysu 阅读(420) 评论(0) 推荐(0)

2016年4月15日

Leetcode 226 Invert Binary Tree python

摘要: 题目: Invert a binary tree. 翻转二叉树。 递归,每次对节点的左右节点调用invertTree函数,直到叶节点。 python中也没有swap函数,当然你可以写一个,不过python中可以通过:a, b = b, a交换两个变量的值 阅读全文

posted @ 2016-04-15 23:33 def_sysu 阅读(349) 评论(0) 推荐(0)

Leetcode 104 Maximum Depth of Binary Tree python

摘要: 题目: 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 farthe 阅读全文

posted @ 2016-04-15 22:42 def_sysu 阅读(295) 评论(0) 推荐(0)

导航