![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
题目
jycynb
这个作者很懒,什么都没留下…
展开
-
Lintcode67 Binary Tree Inorder Traversal solution 题解
【题目描述】Given a binary tree, return the inorder traversal of its nodes' values.给出一棵二叉树,返回其中序遍历 【题目链接】www.lintcode.com/en/problem/binary-tree-inorder-traversal/ 【题目解析】递归版最好理解,递归调用时注意返回值和递归左右子树的顺序即可。迭代版转载 2017-11-07 11:32:51 · 149 阅读 · 0 评论 -
Lintcode72 Construct Binary Tree from Inorder and Postorder Traversal solution 题解
【题目描述】Given inorder and postorder traversal of a tree, construct the binary tree.Notice:You may assume that duplicates do not exist in the tree.根据中序遍历和后序遍历树构造二叉树注意:你可以假设树中不存在相同数值的节点【题目链接】www.lintcode.转载 2017-11-15 22:45:09 · 112 阅读 · 0 评论 -
Lintcode76 Longest Increasing Subsequence solution 题解
【题目描述】Given a sequence of integers, find the longest increasing subsequence (LIS).You code should return the length of the LIS.给定一个整数序列,找到最长上升子序列(LIS),返回LIS的长度。【说明】:最长上升子序列的定义:最长上升子序列问题是在一个无序的给定序列中找到一转载 2017-11-19 23:53:19 · 118 阅读 · 0 评论 -
Lintcode75 Find Peak Element solution 题解
【题目描述】There is an integer array which has the following features:·The numbers in adjacent positions are different.·A[0] A[A.length - 1].We define a position P is a peek if:A[P]>A[P-1]&&A[p]>A[P+1]Fin转载 2017-11-18 08:13:08 · 152 阅读 · 0 评论 -
Lintcode 74 First Bad Version solution 题解
【题目描述】The code base version is an integer start from 1 to n. One day, someone committed a bad version in the code case, so it caused this version and the following versions are all failed in the unit转载 2017-11-17 23:07:56 · 107 阅读 · 0 评论 -
Lintcode71 Binary Tree Zigzag Level Order Traversal solution 题解
【题目描述】Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).给出一棵二叉树,返回其节点值的锯齿形层次遍历(先从转载 2017-11-11 10:08:24 · 101 阅读 · 0 评论 -
Lintcode70 Binary Tree Level Order Traversal II solution 题解
【题目描述】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).给出一棵二叉树,返回其节点值从底向上的层次序遍历(按从叶节点所在层到根节点所在的层遍历,然后逐层从转载 2017-11-10 13:59:16 · 90 阅读 · 0 评论 -
Lintcode69 Binary Tree Level Order Traversal solution 题解
【题目描述】Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).给出一棵二叉树,返回其节点值的层次遍历(逐层从左往右访问) 【题目链接】www.lintcode.com/en/problem/binary-tree-转载 2017-11-09 10:16:11 · 105 阅读 · 0 评论 -
Lintcode68 Binary Tree Postorder Traversal solution 题解
【题目描述】Given a binary tree, return the postorder traversal of its nodes' values.给出一棵二叉树,返回其节点值的后序遍历。 【题目链接】www.lintcode.com/en/problem/binary-tree-postorder-traversal/ 【题目解析】二叉树后序遍历。刚接触leetcode时也做过这道转载 2017-11-08 08:16:47 · 116 阅读 · 0 评论 -
Lintcode73 Construct Binary Tree from Preorder and Inorder Traversal solution 题解
【题目描述】Given preorder and inorder traversal of a tree, construct the binary tree.Notice:You may assume that duplicates do not exist in the tree.根据前序遍历和中序遍历树构造二叉树.注意:你可以假设树中不存在相同数值的节点【题目链接】www.lintcode.转载 2017-11-16 22:30:40 · 131 阅读 · 0 评论