上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 30 下一页

2018年1月10日

Construct Binary Tree from Preorder and Inorder Traversal(根据前序中序构建二叉树)

摘要: 根据前序中序构建二叉树。 参考:https://www.cnblogs.com/springfor/p/3884034.html 阅读全文

posted @ 2018-01-10 12:12 夜的第八章 阅读(127) 评论(3) 推荐(0) 编辑

Validate Binary Search Tree(一定掌握的方法)

摘要: 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 only 阅读全文

posted @ 2018-01-10 10:53 夜的第八章 阅读(146) 评论(0) 推荐(0) 编辑

2018年1月9日

path sum II(深度优先的递归实现掌握)

摘要: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example:Given the below binary tree and sum 阅读全文

posted @ 2018-01-09 20:34 夜的第八章 阅读(133) 评论(0) 推荐(0) 编辑

convert sorted list to binary search tree(将有序链表转成平衡二叉搜索树)

摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced bina 阅读全文

posted @ 2018-01-09 19:26 夜的第八章 阅读(205) 评论(0) 推荐(0) 编辑

Binary Tree Zigzag Level Order Traversal(z字形打印二叉树)

摘要: 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 阅读全文

posted @ 2018-01-09 11:25 夜的第八章 阅读(222) 评论(0) 推荐(0) 编辑

2018年1月8日

java虚拟机的类加载机制

摘要: 引言 我们写的代码是放在.java文件中,经过编译器编译后,转成.class文件。Class文件是一串二进制流,它可以被各平台的虚拟机所接受,实现跨平台。 虚拟机将描述类的数据从class文件加载到内存,并对数据进行校验、解析、初始化,最终形成可以被虚拟机直接使用的Java类型,这就是虚拟机的类加载 阅读全文

posted @ 2018-01-08 21:52 夜的第八章 阅读(196) 评论(5) 推荐(1) 编辑

unique-binary-search-trees II

摘要: Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example,Given n = 3, your program should 阅读全文

posted @ 2018-01-08 16:42 夜的第八章 阅读(117) 评论(0) 推荐(0) 编辑

unique-binary-search-trees

摘要: unique-binary-search-trees 题目: Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example,Given n = 3, the 阅读全文

posted @ 2018-01-08 15:42 夜的第八章 阅读(228) 评论(0) 推荐(0) 编辑

二叉树的先序中序后续遍历(递归非递归)

摘要: 转载:http://blog.csdn.net/jssongwei/article/details/50790253 首先来看一棵二叉树: 1、前序遍历: 前序遍历首先访问根结点然后遍历左子树,最后遍历右子树。在遍历左、右子树时,仍然先访问根结点,然后遍历左子树,最后遍历右子树。 若二叉树为空则结束 阅读全文

posted @ 2018-01-08 14:27 夜的第八章 阅读(1111) 评论(0) 推荐(0) 编辑

reverse Linked List II

摘要: 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 = 2 and n = 4, return 1->4->3->2- 阅读全文

posted @ 2018-01-08 11:00 夜的第八章 阅读(210) 评论(0) 推荐(0) 编辑

上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 30 下一页

导航