最新 最热

DOM 1

首先getAttribute  setAttribute只能被元素节点对象调用。(属性节点和文本节点调用不了)我们可以通过一下三种方式得到元素:document.getElementById();//返回唯一一个元素节点document.getElementsByTagName();//返...

2018-06-28
3

leetcode 25 Reverse Nodes in k-Group

class Solution {public: ListNode* reverseKGroup(ListNode* head, int k) { ListNode *cur = head; for (int i = 0; i < k; ++i) { if...

2018-06-04
1

leetcode 24 Swap Nodes in Pairs

class Solution {public: ListNode* swapPairs(ListNode* head) { if (!head || !head->next) return head; ListNode *t = head->next; head...

2018-06-04
1

Leetcode 94 Binary Tree Inorder Traversal

Given a binary tree, return the inorder traversal of its nodes' values. For example: Given binary tree [1,null,2,3], 1 2 / 3 return [...

2018-01-12
3

Leetcode 82 Remove Duplicates from Sorted List II

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example, Given 1->2->3->3...

2018-01-12
1

Leetcode 100 Same Tree

Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical and the n...

2018-01-12
1

Leetcode 145 Binary Tree Postorder Traversal

Given a binary tree, return the postorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 2 / 3 return [3...

2018-01-12
3

Leetcode 144 Binary Tree Preorder Traversal

Given a binary tree, return the preorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 2 / 3 return [1,...

2018-01-12
3

Leetcode 143 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 exam...

2018-01-12
1