【109-Convert Sorted List to Binary Search Tree(排序链表转换成二叉排序树)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a singly linked list where elements are sorted in ascending order, convert it to a height balanc...
分类:
编程语言 时间:
2015-08-10 08:14:28
阅读次数:
157
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
Integers in each row are sorted in ascending from left to right.Integers in ...
分类:
其他好文 时间:
2015-08-10 00:33:22
阅读次数:
139
【070-Set Matrix Zeroes(矩阵置零)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
题目大意 给定一个m*n的矩阵,如果某个位置是0。将对应的行和列设置为0。...
分类:
编程语言 时间:
2015-08-09 07:13:48
阅读次数:
157
【104-Maximum Depth of Binary Tree(二叉树的最大深度)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from th...
分类:
编程语言 时间:
2015-08-08 07:59:24
阅读次数:
126
【103-Binary Tree Zigzag Level Order Traversal(二叉树分层Z字形遍历)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to righ...
分类:
编程语言 时间:
2015-08-08 07:58:56
阅读次数:
182
【102-Binary Tree Level Order Traversal(二叉树层序遍历)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level...
分类:
编程语言 时间:
2015-08-08 07:58:06
阅读次数:
259
【101-Symmetric Tree(对称树)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree is symmetr...
分类:
编程语言 时间:
2015-08-07 08:19:16
阅读次数:
163
【100-Same Tree(两棵树是否相同)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structural...
分类:
编程语言 时间:
2015-08-07 08:18:10
阅读次数:
185
【092-Reverse Linked List II(反转单链表II)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Reverse a linked list from position m to n. Do it in-place and in one-pass.
For example:
Given 1->2->3->4->5->NULL, m =...
分类:
编程语言 时间:
2015-08-06 08:16:04
阅读次数:
195