飘落的树叶

导航

2014年6月13日 #

[LeetCode]Climbing Stairs

摘要: Description: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 c... 阅读全文

posted @ 2014-06-13 15:12 飘落的树叶 阅读(144) 评论(0) 推荐(0)

[LeetCode]Pascal's Triangle

摘要: Description:GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1],... 阅读全文

posted @ 2014-06-13 15:09 飘落的树叶 阅读(114) 评论(0) 推荐(0)

[LeetCode]Pow(x, n)

摘要: Description:Implement pow(x, n)大意:实现pow(x, n),即通常所说的x的n次方。分析:真是一道很考验人的题目,看似简单,其实有非常多的细节要注意:1)由于x及返回值都是浮点数(double),那么许多自定义的变量、返回值都尽量使用#.0f的方式定义与实现,显得正式... 阅读全文

posted @ 2014-06-13 15:08 飘落的树叶 阅读(178) 评论(0) 推荐(0)

[LeetCode]Swap Nodes in Pairs

摘要: Description:Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->... 阅读全文

posted @ 2014-06-13 15:05 飘落的树叶 阅读(108) 评论(0) 推荐(0)

[LeetCode]Gray Code

摘要: Description:The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the ... 阅读全文

posted @ 2014-06-13 15:04 飘落的树叶 阅读(132) 评论(0) 推荐(0)

[LeetCode]Merge Sorted Array

摘要: Description:Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is grea... 阅读全文

posted @ 2014-06-13 15:03 飘落的树叶 阅读(109) 评论(0) 推荐(0)