上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页
摘要: Majority ElementGiven an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may ass... 阅读全文
posted @ 2015-09-06 16:08 Sean_le 阅读(194) 评论(0) 推荐(0) 编辑
摘要: N-Queens IIFollow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.和上题N-Queens几乎一样,... 阅读全文
posted @ 2015-09-06 00:00 Sean_le 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 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 @ 2015-09-05 23:58 Sean_le 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Populating Next Right Pointers in Each Node IIFollow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any ... 阅读全文
posted @ 2015-09-05 14:51 Sean_le 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Populating Next Right Pointers in Each NodeGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLi... 阅读全文
posted @ 2015-09-05 13:20 Sean_le 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Binary Tree Postorder TraversalGiven a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \... 阅读全文
posted @ 2015-09-04 23:42 Sean_le 阅读(112) 评论(0) 推荐(0) 编辑
摘要: Binary Tree Inorder TraversalGiven a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ ... 阅读全文
posted @ 2015-09-04 23:38 Sean_le 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Binary Tree Preorder TraversalGiven a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ ... 阅读全文
posted @ 2015-09-04 22:45 Sean_le 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Number of 1 BitsWrite a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For exampl... 阅读全文
posted @ 2015-09-04 22:28 Sean_le 阅读(81) 评论(0) 推荐(0) 编辑
摘要: Best Time to Buy and Sell Stock IVSay you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the ... 阅读全文
posted @ 2015-09-04 20:19 Sean_le 阅读(117) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页