码迷,mamicode.com
首页 >  
搜索关键字:its    ( 9997个结果
LeetCode解题报告:Binary Tree Postorder Traversal
Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1].No...
分类:其他好文   时间:2014-06-18 17:32:02    阅读次数:168
[LeetCode OJ] Symmetric Tree
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 / \ ...
分类:其他好文   时间:2014-06-18 13:29:31    阅读次数:214
[LeetCode] Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:其他好文   时间:2014-06-18 12:51:52    阅读次数:205
【Leetcode】Set Matrix Zeroes
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. Could you devise a constant space solution? 思路:因为需要遍历整个矩阵,时间复杂度肯定需要O(m * n),对于空间复杂度而言,第一种是可以使用O(m * n),...
分类:其他好文   时间:2014-06-18 12:33:39    阅读次数:167
Swap Nodes in Pairs
题目 Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your algorithm should use only const...
分类:其他好文   时间:2014-06-18 11:53:39    阅读次数:138
Remove Nth Node From End of List
题目 Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from th...
分类:其他好文   时间:2014-06-17 21:38:12    阅读次数:193
Merge k Sorted Lists
题目 Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 方法 使用归并排序的思想,两两合并,直到最终变成一个。 public ListNode mergeKLists(ArrayList lists) {...
分类:其他好文   时间:2014-06-17 21:34:41    阅读次数:183
A Woman Can Look Trendy By Carrying An Elegant Bag
Since we only have one bag to pay for it is something that you will not miss.Its always wanted to fight a bag of coffee. See the code inside - dark al...
分类:其他好文   时间:2014-06-17 15:27:14    阅读次数:204
【Leetcode】Binary Tree Level Order Traversal II
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For example: Given binary tree {3,9,20,#,#,15,7}, ...
分类:其他好文   时间:2014-06-15 15:17:43    阅读次数:192
【Leetcode】Binary Tree Level Order Traversal
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example: Given binary tree {3,9,20,#,#,15,7}, 3 / 9 20 ...
分类:其他好文   时间:2014-06-15 13:26:54    阅读次数:200
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!