
leetcode
domyself
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
OJ-Populating Next Right Pointers in Each Node
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its next right node.原创 2014-04-10 08:54:13 · 498 阅读 · 0 评论 -
Reorder List
Given a singly linked list L: 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' values. For example, Given {1,2,3,4}, reorder it to {1,4原创 2014-05-25 20:35:13 · 424 阅读 · 0 评论 -
SymmetricTree
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 / \ 2 2 / \ / \ 3 4 4 3 But the f原创 2014-04-11 11:30:53 · 492 阅读 · 0 评论 -
带环链表
It is a famous known problem Hare and Tortoise Length of head to cycle started node:x Length of the cycle: y Let hare run two steps while tortoise runs one step while both of them entered the转载 2014-04-10 16:50:34 · 499 阅读 · 0 评论 -
Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it without using extra space? 思路:原创 2014-05-25 21:41:46 · 521 阅读 · 0 评论 -
Remove Nth Node From End of List
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode *re原创 2014-08-24 21:30:29 · 536 阅读 · 0 评论 -
Rotate List
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode *ro原创 2014-08-24 22:16:02 · 469 阅读 · 0 评论 -
Valid Palindrome
遇到一些新的函数中的transform()原创 2014-09-13 00:04:37 · 600 阅读 · 0 评论 -
Search in Rotated Sorted Array
Search in Rotated Sorted Array Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a target value原创 2014-08-30 13:34:40 · 505 阅读 · 0 评论