摘要:
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 of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] 阅读全文
摘要:
1.1 概述 GC需要考虑的事:哪些内存需要回收,什么时候回收,如何回收 我们只要在程序出于运行期间的时候才会知道创建哪些对象,这部分内存和回收都是动态的,垃圾回收器所关注的就是这部分内存 1.2 对象已死吗? 回收的前提就是判断对象是否还存活 1.2.1 引用计数算法 给一个对象添加一个计数器,若 阅读全文
摘要:
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are n 阅读全文