摘要: leetcode好博文:http://blog.csdn.net/crazy1235/article/details/51420522 阅读全文
posted @ 2016-09-04 23:21 pulusite 阅读(301) 评论(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 @ 2016-09-04 23:17 pulusite 阅读(97) 评论(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 is 1 -> 2 -> 3 - 阅读全文
posted @ 2016-09-04 23:11 pulusite 阅读(115) 评论(0) 推荐(0)
摘要: Given two arrays, write a function to compute their intersection. Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. Note: Each element i 阅读全文
posted @ 2016-09-04 23:08 pulusite 阅读(119) 评论(0) 推荐(0)
摘要: 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, giv 阅读全文
posted @ 2016-09-04 23:02 pulusite 阅读(188) 评论(0) 推荐(0)
摘要: Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at 阅读全文
posted @ 2016-09-04 22:58 pulusite 阅读(298) 评论(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 @ 2016-09-04 22:54 pulusite 阅读(96) 评论(0) 推荐(0)
摘要: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: 阅读全文
posted @ 2016-09-04 22:42 pulusite 阅读(105) 评论(0) 推荐(0)
摘要: Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear runtime complex 阅读全文
posted @ 2016-09-04 22:18 pulusite 阅读(98) 评论(0) 推荐(0)
摘要: Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example:Given a = 1 and b = 2, return 3. 用 异或 表示sum,与 阅读全文
posted @ 2016-09-04 22:02 pulusite 阅读(120) 评论(0) 推荐(0)
摘要: You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 ston 阅读全文
posted @ 2016-09-04 21:54 pulusite 阅读(151) 评论(0) 推荐(0)
摘要: Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". 即反转字符串,逆序遍历依次append到StringBu 阅读全文
posted @ 2016-09-04 21:49 pulusite 阅读(107) 评论(0) 推荐(0)