IncredibleThings

导航

上一页 1 2 3 4 5 6 7 8 9 ··· 28 下一页

2020年10月14日 #

LeetCode - Construct Binary Tree from Preorder and Inorder Traversal

摘要: Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. For example, 阅读全文

posted @ 2020-10-14 12:27 IncredibleThings 阅读(79) 评论(0) 推荐(0)

2020年10月13日 #

LeetCode - Convert Sorted List to Binary Search Tree

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

posted @ 2020-10-13 12:50 IncredibleThings 阅读(112) 评论(0) 推荐(0)

2020年6月3日 #

LeetCode - Delete Node in a BST

摘要: Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of th 阅读全文

posted @ 2020-06-03 12:48 IncredibleThings 阅读(159) 评论(0) 推荐(0)

2020年5月20日 #

LeetCode - Serialize and Deserialize BST

摘要: 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 @ 2020-05-20 13:46 IncredibleThings 阅读(173) 评论(0) 推荐(0)

2020年5月11日 #

LeetCode - House Robber III

摘要: The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each hou 阅读全文

posted @ 2020-05-11 14:37 IncredibleThings 阅读(111) 评论(0) 推荐(0)

2020年5月4日 #

LeetCode - Kth Smallest Element in a BST

摘要: Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's 阅读全文

posted @ 2020-05-04 14:54 IncredibleThings 阅读(113) 评论(0) 推荐(0)

LeetCode - Count Complete Tree Nodes

摘要: Given a complete binary tree, count the number of nodes. Note: Definition of a complete binary tree from Wikipedia: In a complete binary tree every le 阅读全文

posted @ 2020-05-04 14:23 IncredibleThings 阅读(111) 评论(0) 推荐(0)

2020年5月3日 #

LeetCode - Sum Root to Leaf Numbers

摘要: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 whic 阅读全文

posted @ 2020-05-03 14:33 IncredibleThings 阅读(119) 评论(0) 推荐(0)

LeetCode - Binary Tree Maximum Path Sum

摘要: Given a non-empty 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 阅读全文

posted @ 2020-05-03 13:50 IncredibleThings 阅读(115) 评论(0) 推荐(0)

2020年4月24日 #

LeetCode - Flatten Binary Tree to Linked List

摘要: Given a binary tree, flatten it to a linked list in-place. For example, given the following tree: 1 / \ 2 5 / \ \ 3 4 6 The flattened tree should look 阅读全文

posted @ 2020-04-24 13:42 IncredibleThings 阅读(83) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 9 ··· 28 下一页