摘要:
Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is a 阅读全文
posted @ 2016-09-10 08:03
Machelsky
阅读(155)
评论(0)
推荐(0)
摘要:
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of 阅读全文
posted @ 2016-09-10 07:37
Machelsky
阅读(124)
评论(0)
推荐(0)
摘要:
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the dept 阅读全文
posted @ 2016-09-10 06:24
Machelsky
阅读(133)
评论(0)
推荐(0)
摘要:
思路:递归。 null也是tree。 null tree (definition) Definition: (1) A tree which is empty. (2) A tree whose leaf nodes all have a null value. https://xlinux.nis 阅读全文
posted @ 2016-09-10 05:09
Machelsky
阅读(126)
评论(0)
推荐(0)
摘要:
思路:纯递归。 阅读全文
posted @ 2016-09-10 04:57
Machelsky
阅读(99)
评论(0)
推荐(0)
摘要:
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight). For example, the 32-bit i 阅读全文
posted @ 2016-09-10 03:42
Machelsky
阅读(192)
评论(0)
推荐(0)