• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
ArgenBarbie
博客园    首页    新随笔    联系   管理    订阅  订阅
2016年4月21日
331. Verify Preorder Serialization of a Binary Tree -- 判断是否为合法的先序序列
摘要: One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node's value. If it is a null node, 阅读全文
posted @ 2016-04-21 19:20 ArgenBarbie 阅读(257) 评论(0) 推荐(0)
310. Minimum Height Trees -- 找出无向图中以哪些节点为根,树的深度最小
摘要: For a undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree. Among all possible roote 阅读全文
posted @ 2016-04-21 19:04 ArgenBarbie 阅读(405) 评论(0) 推荐(0)
297. Serialize and Deserialize Binary Tree *HARD*
摘要: Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or 阅读全文
posted @ 2016-04-21 17:41 ArgenBarbie 阅读(204) 评论(0) 推荐(0)
235.236. Lowest Common Ancestor of a Binary (Search) Tree -- 最近公共祖先
摘要: 235. Lowest Common Ancestor of a Binary Search Tree Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the 阅读全文
posted @ 2016-04-21 16:04 ArgenBarbie 阅读(200) 评论(0) 推荐(0)
222. Count Complete Tree Nodes -- 求完全二叉树节点个数
摘要: Given a complete binary tree, count the number of nodes. Definition of a complete binary tree from Wikipedia:In a complete binary tree every level, ex 阅读全文
posted @ 2016-04-21 15:30 ArgenBarbie 阅读(157) 评论(0) 推荐(0)
208. Implement Trie (Prefix Tree) -- 键树
摘要: Implement a trie with insert, search, and startsWith methods. Note:You may assume that all inputs are consist of lowercase letters a-z. 阅读全文
posted @ 2016-04-21 14:52 ArgenBarbie 阅读(178) 评论(0) 推荐(0)
173. Binary Search Tree Iterator -- 迭代器
摘要: Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST. Calling next() will return the n 阅读全文
posted @ 2016-04-21 13:11 ArgenBarbie 阅读(125) 评论(0) 推荐(0)
124. Binary Tree Maximum Path Sum *HARD* -- 二叉树中节点和最大的路径的节点和
摘要: Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any node in th 阅读全文
posted @ 2016-04-21 11:15 ArgenBarbie 阅读(170) 评论(0) 推荐(0)
114. Flatten Binary Tree to Linked List -- 将二叉树转成链表(in-place单枝树)
摘要: Given a binary tree, flatten it to a linked list in-place. For example,Given The flattened tree should look like: If you notice carefully in the flatt 阅读全文
posted @ 2016-04-21 10:53 ArgenBarbie 阅读(174) 评论(0) 推荐(0)
108. Convert Sorted Array to Binary Search Tree 109. Convert Sorted List to Binary Search Tree -- 将有序数组或有序链表转成平衡二叉排序树
摘要: 108. Convert Sorted Array to Binary Search Tree Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 109. 阅读全文
posted @ 2016-04-21 10:14 ArgenBarbie 阅读(171) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3