摘要: 题目:Write a SQL query to find all duplicate emails in a table namedPerson.+----+---------+| Id | Email |+----+---------+| 1 | a@b.com || 2 | c@d.co... 阅读全文
posted @ 2015-10-31 19:56 savageclc26 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 题目:TheEmployeetable holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id.+----+------... 阅读全文
posted @ 2015-10-31 19:39 savageclc26 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 题目:给出一个字符串Initial和另一个字符串Detection,判断Detection是否为Initial的一个出栈序列如:Initial =123456,Detection =213654, 则Detection是Initial的一个出栈序列思路一:可以使用栈代码: public sta... 阅读全文
posted @ 2015-10-28 19:43 savageclc26 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 题目:反转一个句子,要求句子中的每个单子都被反转,但单词本身不被反转如:I am a Boy! 反转为:Boy! a am I思路:左旋转处理1. 将整个句子的所有字符统一反转2. 根据空格,阶段单词,再反转每一个单词代码: public static String ReversalStrin... 阅读全文
posted @ 2015-10-28 19:12 savageclc26 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 题目:Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive inte... 阅读全文
posted @ 2015-10-21 11:43 savageclc26 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 题目:Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3, 5. For ex... 阅读全文
posted @ 2015-10-21 10:12 savageclc26 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 题目:Clone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.OJ's undirected graph serialization:Nodes are labeled u... 阅读全文
posted @ 2015-10-16 11:50 savageclc26 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 题目:有一个宽为W个小格,高为H个小格,总小格数为W*H的棋盘。棋盘中,可以被涂色的小格用"P"标识,不可以涂色的小格用"B"标识,可以涂色也可以选择不涂色的小格用"?"标识。如下W=5, H=4的棋盘PPPBBPP?BBPP?PPBBP?P有一个儿童,手中有1*1 , 2*2, 3*3 等方形图章... 阅读全文
posted @ 2015-10-15 16:26 savageclc26 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 题目:You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?思路1:找对应关系,90度翻转是... 阅读全文
posted @ 2015-10-14 19:11 savageclc26 阅读(132) 评论(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 de... 阅读全文
posted @ 2015-10-14 18:18 savageclc26 阅读(113) 评论(0) 推荐(0) 编辑