![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode
文章平均质量分 59
wangkexue
这个作者很懒,什么都没留下…
展开
-
Leetcode Word Ladder 200ms
欢迎大家点评。/* bidirection search * time O(2d^{d/2}) space O(4n) * 200ms 37/37 */class Solution {public: int ladderLength(string start, string end, unordered_set &dict) { if (start == end)原创 2014-11-11 12:20:00 · 518 阅读 · 0 评论 -
Leetcode divide two integers
class Solution {public: int divide(int dividend, int divisor) { assert(divisor != 0); unsigned int divid, divis; divid = (dividend < 0) ? -dividend : dividend; div原创 2014-11-27 13:56:35 · 444 阅读 · 0 评论 -
[Leetcode] Binary Tree Upside Down
class Solution {private: TreeNode *upside;public: TreeNode *upsideDownBinaryTree(TreeNode *root) { if (root) helper(root); return upside; } TreeNode* help原创 2014-11-28 08:49:23 · 878 阅读 · 0 评论 -
[Leetcode] Intersection of Two Linked Lists
class Solution {public: ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) { if (headA == NULL || headB == NULL) return NULL; int lenA = 0; int lenB = 0;原创 2014-11-28 06:53:06 · 510 阅读 · 0 评论 -
[Leetcode] Longest Substring with At Most Two Distinct Characters
~原创 2014-11-28 06:50:05 · 1147 阅读 · 1 评论 -
[leetcode] Two Sum II
.原创 2014-12-19 14:15:57 · 471 阅读 · 0 评论