传送门 Description Determine whether an integer is a palindrome. Do this without extra space. Determine whether an integer is a palindrome. Do this witho ...
分类:
其他好文 时间:
2017-08-14 01:25:39
阅读次数:
121
Consider a group of N students and P courses. Each student visits zero, one or more than one courses. Your task is to determine whether it is possible ...
分类:
编程语言 时间:
2017-08-13 10:05:48
阅读次数:
241
题目:Power of Two Given an integer, write a function to determine if it is a power of two. 题意:判断一个数是否是2的k次方数。 思路: 2的次方数使用2进制表示则必然只有最高位是1其他都是0; 这样判断一个数最多 ...
分类:
其他好文 时间:
2017-08-11 20:27:17
阅读次数:
161
翻译 给定一个二叉树,决定它是否是高度平衡的。(高度是名词不是形容词…… 对于这个问题。一个高度平衡二叉树被定义为: 这棵树的每一个节点的两个子树的深度差不能超过1。 原文 Given a binary tree, determine if it is height-balanced. For th ...
分类:
其他好文 时间:
2017-08-09 22:25:01
阅读次数:
162
回溯法的典型 1、Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the giv ...
分类:
其他好文 时间:
2017-08-09 11:25:11
阅读次数:
153
20. Valid Parentheses Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brack ...
分类:
其他好文 时间:
2017-08-09 00:06:05
阅读次数:
100
In a small restaurant there are a tables for one person and b tables for two persons. It it known that n groups of people come today, each consisting ...
分类:
其他好文 时间:
2017-08-08 17:48:47
阅读次数:
162
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", t = ...
分类:
其他好文 时间:
2017-08-08 14:00:49
阅读次数:
109
Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints: Could negative integers be palindromes? ...
分类:
其他好文 时间:
2017-08-08 00:43:19
阅读次数:
199
代码: class Solution { public: /** * Determine whether s3 is formed by interleaving of s1 and s2. * @param s1, s2, s3: As description. * @return: true o ...
分类:
其他好文 时间:
2017-08-07 00:19:13
阅读次数:
151