上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 16 下一页
摘要: 题目; Given inorder and postorder traversal of a tree, construct the binary tree. 题意及分析:给出棵二叉树的中序遍历和后续遍历,求这棵树。同用先序和中序推二叉树,不同的点是,后序遍历的最后一个点才是根节点。 代码: 阅读全文
posted @ 2017-07-18 10:12 荒野第一快递员 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 题目: Given preorder and inorder traversal of a tree, construct the binary tree. 题意及分析:给出一棵树的先序遍历和中序遍历,要求给出给出该二叉树。先序遍历第一个节点肯定是根节点,那么这样就可以利用中序遍历找出树的左右子树, 阅读全文
posted @ 2017-07-18 09:44 荒野第一快递员 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 farthe 阅读全文
posted @ 2017-07-17 21:02 荒野第一快递员 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 tre 阅读全文
posted @ 2017-07-17 20:13 荒野第一快递员 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is sy 阅读全文
posted @ 2017-07-17 09:56 荒野第一快递员 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 题目: Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identic 阅读全文
posted @ 2017-07-14 21:11 荒野第一快递员 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains 阅读全文
posted @ 2017-07-14 20:19 荒野第一快递员 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 题目: All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful 阅读全文
posted @ 2017-07-13 11:37 荒野第一快递员 阅读(415) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elemen 阅读全文
posted @ 2017-07-13 09:49 荒野第一快递员 阅读(370) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an array of integers, every element appears three times except for one, which appears exactly once. Find that single one. 题意及分析:找出数组中出现一次的数,其 阅读全文
posted @ 2017-07-12 21:52 荒野第一快递员 阅读(251) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 16 下一页