摘要:
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or 阅读全文
摘要:
Given a non-empty array of integers, return the k most frequent elements. Example 1: Example 2: Input: nums = [1], k = 1 Output: [1] Example 2: Note: 阅读全文
摘要:
Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums except n 阅读全文
摘要:
Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a 阅读全文
摘要:
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 阅读全文
摘要:
Given a non-negative integer N, find the largest number that is less than or equal to N with monotone increasing digits. (Recall that an integer has m 阅读全文
摘要:
You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee 阅读全文