摘要: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For 阅读全文
posted @ 2017-03-15 18:57 Ci_pea 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l 阅读全文
posted @ 2017-03-15 18:08 Ci_pea 阅读(89) 评论(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 l 阅读全文
posted @ 2017-03-15 16:58 Ci_pea 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmet 阅读全文
posted @ 2017-03-15 16:37 Ci_pea 阅读(117) 评论(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 a 阅读全文
posted @ 2017-03-15 15:42 Ci_pea 阅读(94) 评论(0) 推荐(0) 编辑
摘要: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:You may assume that nums1 has enough space (size tha 阅读全文
posted @ 2017-03-15 15:22 Ci_pea 阅读(103) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, 阅读全文
posted @ 2017-03-15 14:52 Ci_pea 阅读(106) 评论(0) 推荐(0) 编辑
摘要: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文
posted @ 2017-03-14 19:49 Ci_pea 阅读(96) 评论(0) 推荐(0) 编辑
摘要: Implement int sqrt(int x). Compute and return the square root of x. 牛顿法 二分法 阅读全文
posted @ 2017-03-14 19:22 Ci_pea 阅读(103) 评论(0) 推荐(0) 编辑
摘要: Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100". bin():将整数x转换为二进制字符串,前面会带'0b'; int(a,2),a是二 阅读全文
posted @ 2017-03-14 18:55 Ci_pea 阅读(118) 评论(0) 推荐(0) 编辑