摘要:
Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. Example: Input: 1 \ 3 / 2 O 阅读全文
摘要:
Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all 阅读全文
摘要:
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is d 阅读全文
摘要:
[抄题]: Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You 阅读全文
摘要:
[抄题]: Invert a binary tree. Example: Input: 4 / \ 2 7 / \ / \ 1 3 6 9 Output: 4 / \ 7 2 / \ / \ 9 6 3 1 复习时还不会的地方:没啥了,就加个null的判断条件就行了 [暴力解法]: 时间分析: 空间 阅读全文
摘要:
[抄题]: Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space for anot 阅读全文
摘要:
[抄题]: [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空间分析: [奇葩输出条件]: [奇葩corner case]: [思维问题]: [英文数据结构或算法,为什么不用别的数据结构或算法]: [一句话思路]: [输入量]:空: 正常情况:特大:特小:程序里处理到的特殊情况:异 阅读全文
摘要:
[抄题]: [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空间分析: [奇葩输出条件]: [奇葩corner case]: [思维问题]: [英文数据结构或算法,为什么不用别的数据结构或算法]: [一句话思路]: [输入量]:空: 正常情况:特大:特小:程序里处理到的特殊情况:异 阅读全文
摘要:
[抄题]: https://practice.geeksforgeeks.org/problems/delete-a-node-in-single-linked-list/1 从前往后,删除第N个 [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空间分析: [奇葩输出条件]: [奇 阅读全文
摘要:
[抄题]: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Given linked list -- head = [4,5,1, 阅读全文