10 2014 档案

摘要:Reorder ListGiven a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' val... 阅读全文
posted @ 2014-10-31 15:52 陆草纯 阅读(571) 评论(0) 推荐(0) 编辑
摘要:Convert Sorted List to Binary Search TreeGiven a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.... 阅读全文
posted @ 2014-10-30 10:14 陆草纯 阅读(1854) 评论(0) 推荐(0) 编辑
摘要:Climbing StairsYou 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 way... 阅读全文
posted @ 2014-10-15 15:56 陆草纯 阅读(179) 评论(0) 推荐(0) 编辑
摘要:Pascal's TriangleGivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,... 阅读全文
posted @ 2014-10-12 22:07 陆草纯 阅读(3686) 评论(0) 推荐(1) 编辑
摘要:N-QueensThen-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return all... 阅读全文
posted @ 2014-10-12 13:56 陆草纯 阅读(1548) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示