【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
【106-Construct Binary Tree from Inorder and Postorder Traversal(通过中序和后序遍历构造二叉树II)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given inorder and postorder traversal of a tree, construct the binary tree.
No...
分类:
编程语言 时间:
2015-08-09 07:14:18
阅读次数:
192
【106-Construct Binary Tree from Preorder and Inorder Traversal(通过前序和中序遍历构造二叉树)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given preorder and inorder traversal of a tree, construct the binary tree.
Note:...
分类:
编程语言 时间:
2015-08-09 07:13:59
阅读次数:
234
【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
【096-Unique Binary Search Trees(唯一二叉搜索树)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given n, how many structurally unique BST’s (binary search trees) that store values 1…n?
For example,
Given n = 3, t...
分类:
编程语言 时间:
2015-08-07 08:18:59
阅读次数:
172
【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