上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 18 下一页
摘要: 题目描述: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 ... 阅读全文
posted @ 2016-01-13 18:55 scottwang 阅读(175) 评论(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 ... 阅读全文
posted @ 2016-01-12 17:50 scottwang 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Given an integer, write a function to determine if it is a power of three.Follow up:Could you do it without using any loop / recursion?解题思路:对给定的数... 阅读全文
posted @ 2016-01-10 21:23 scottwang 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Given an integer, write a function to determine if it is a power of two.解题思路:判断方法主要依据2的N次幂的特点:仅有首位为1,其余各位都为0.代码如下:public class Solution { publ... 阅读全文
posted @ 2016-01-05 14:48 scottwang 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in fr... 阅读全文
posted @ 2016-01-05 14:22 scottwang 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in fr... 阅读全文
posted @ 2016-01-05 14:22 scottwang 阅读(223) 评论(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 in... 阅读全文
posted @ 2015-12-28 15:32 scottwang 阅读(237) 评论(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 ... 阅读全文
posted @ 2015-12-28 14:52 scottwang 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3,... 阅读全文
posted @ 2015-12-28 14:40 scottwang 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 题目描述:You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you ... 阅读全文
posted @ 2015-12-28 14:11 scottwang 阅读(189) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 18 下一页