码迷,mamicode.com
首页 >  
搜索关键字:definition    ( 2735个结果
LeetCode – Refresh – Intersection of Two Linked Lists
Find the common length part, then check with two pointers. 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 *...
分类:其他好文   时间:2015-03-20 06:57:04    阅读次数:135
LeetCode – Refresh – Insert Inverval
Similar to merge intervals. But this is easier than merge interval, because every side is kind of "sorted". 1 /** 2 * Definition for an interval. 3 .....
分类:其他好文   时间:2015-03-20 06:50:10    阅读次数:123
Symmetric Tree
/* 给一颗二叉树,问是否关于中心对称*//** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNod...
分类:其他好文   时间:2015-03-19 23:46:10    阅读次数:152
Balanced Binary Tree
/*判断一颗二叉树是否是平衡二叉树(左右子节点的高度差不超过1或者是颗空树)*//** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *righ...
分类:其他好文   时间:2015-03-19 23:28:57    阅读次数:200
LeetCode – Refresh – Construct Binary Tree from Inorder and Preorder Traversal
Only different with preorder and postorder is that the root start from the beginning for preorder. 1 /** 2 * Definition for binary tree 3 * struct T.....
分类:其他好文   时间:2015-03-19 06:20:26    阅读次数:122
LeetCode – Refresh – Clone Graph
1. Use BFS to search the graph.2. Create a hashtable to record the one to one mapping. 1 /** 2 * Definition for undirected graph. 3 * struct Undirec.....
分类:其他好文   时间:2015-03-19 06:19:16    阅读次数:125
二叉树的非递归遍历(先序, 中序, 后序)
先序遍历:/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), ...
分类:其他好文   时间:2015-03-18 13:48:17    阅读次数:124
Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull./** * Definition for singly-linked list. * class ListNod...
分类:其他好文   时间:2015-03-18 13:45:39    阅读次数:107
LeetCode – Refresh – Binary Tree Zigzag Level Order Traversal
Made a stupid bug....... When reverse the vector, stop it at mid. Otherwise, it will swap back......Mark!!!!!!!! 1 /** 2 * Definition for binary tree....
分类:其他好文   时间:2015-03-18 10:23:29    阅读次数:120
LeetCode – Refresh – Binary Tree Level Order Traversal
Basic question. Use a queue to store Node, use two numbers to record current level node numbers and next level node numbers. 1 /** 2 * Definition for....
分类:其他好文   时间:2015-03-18 08:58:27    阅读次数:105
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!