Interleaving StringGiven s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = ...
分类:
其他好文 时间:
2014-12-27 21:40:23
阅读次数:
326
Using O(1) time to check whether an integer n is a power of 2.ExampleFor n=4, return trueFor n=5, return falseChallengeO(1) timeAnalysis:Use bit manip...
分类:
其他好文 时间:
2014-12-27 06:44:21
阅读次数:
179
描述:Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are thi...
分类:
其他好文 时间:
2014-12-24 19:57:39
阅读次数:
127
【题目】
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree is symmetric:
1
/ 2 2
/ \ / 3 4 4 3...
分类:
其他好文 时间:
2014-12-24 10:00:49
阅读次数:
181
Given an array, determine whether there are three elements A[i],A[j],A[k], such that A[i]A[twoLen]) return true; 9 if (twoLen!=-1 && A[i]>...
分类:
其他好文 时间:
2014-12-24 06:25:20
阅读次数:
202
同样的雪花时间限制:1000ms | 内存限制:65535KB难度:4描写叙述You may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this ...
分类:
其他好文 时间:
2014-12-23 18:59:22
阅读次数:
155
question(题意):
Describe a O(n lg(n))-time algorithm that, given a set S of n integers and another integer x, determines whether or not there exist two elements in S whose sum is exactly x.
设计一个O(n ...
分类:
编程语言 时间:
2014-12-23 09:05:46
阅读次数:
239
Determine whether an integer is a palindrome. Do this without extra space.对于这道题不能用额外的空间,即不能用一个数组来保存各个位数,因此对于这种问题可以采用判断两头数字的方法 1 package Palindrome.Num...
分类:
其他好文 时间:
2014-12-22 22:42:10
阅读次数:
167
标题:Symmetric Tree通过率:31.1%难度:简单Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary ...
分类:
其他好文 时间:
2014-12-21 23:18:31
阅读次数:
226
Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers b...
分类:
其他好文 时间:
2014-12-21 22:00:15
阅读次数:
131