上一页 1 2 3 4 5 6 7 8 ··· 17 下一页
摘要: Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the dept 阅读全文
posted @ 2016-11-08 22:16 wangxiaobao1114 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 作者:阮一峰 原文链接:http://www.ruanyifeng.com/blog/2011/12/inode.html 一、inode是什么? 理解inode,要从文件储存说起。 文件储存在硬盘上,硬盘的最小存储单位叫做"扇区"(Sector)。每个扇区储存512字节(相当于0.5KB)。 操作 阅读全文
posted @ 2016-11-08 13:07 wangxiaobao1114 阅读(239) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. (Medium) 分析: 链表不同于数组的是需要先遍历一遍求出长度,然后再找到中 阅读全文
posted @ 2016-11-07 19:30 wangxiaobao1114 阅读(210) 评论(0) 推荐(0) 编辑
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST. (Medium) 分析: 因为要构成BBST,所以要从中点开始,左边为左子树,右边为右子树,采用help 阅读全文
posted @ 2016-11-07 19:28 wangxiaobao1114 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 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). (Eas 阅读全文
posted @ 2016-11-05 16:58 wangxiaobao1114 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Given inorder and postorder traversal of a tree, construct the binary tree. (Medium) Note:You may assume that duplicates do not exist in the tree. 分析: 阅读全文
posted @ 2016-11-05 16:55 wangxiaobao1114 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Given preorder and inorder traversal of a tree, construct the binary tree. (Medium) Note:You may assume that duplicates do not exist in the tree. 分析: 阅读全文
posted @ 2016-11-05 16:53 wangxiaobao1114 阅读(148) 评论(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 farthest l 阅读全文
posted @ 2016-11-05 16:44 wangxiaobao1114 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). (Easy) For example:Given binary 阅读全文
posted @ 2016-11-05 16:42 wangxiaobao1114 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). (Easy) For example, this binary tree [1,2,2,3,4,4,3] is 阅读全文
posted @ 2016-11-05 16:40 wangxiaobao1114 阅读(155) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 17 下一页