摘要:
同步器是用来构建锁和其他同步组件的基础框架,它的实现主要依赖一个int成员变量来表示同步状态以及通过一个FIFO队列构成等待队列 阅读全文
摘要:
对象的内存分配,往大方向讲,就是在**堆上进行分配**,对象主要分配在**新生代的Eden区上**,如果启用了**本地线程分配缓冲**,将按线程优先在TLAB上进行分配,少数情况下也会直接分配在老年代。 阅读全文
摘要:
输入两个单调递增的链表,输出两个链表合成后的链表,当然我们需要合成后的链表满足单调不减规则。 阅读全文
摘要:
输入一个链表,反转链表后,输出新链表的表头。 阅读全文
摘要:
输入一个链表,输出该链表中倒数第k个结点。 阅读全文
摘要:
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 tree consists of a node in s and all of this node's descendants. The tree s could also be considered as a subtree of itself. 阅读全文
摘要:
Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the **longest** path between any two nodes in a tree. This path may or may not pass through the root. 阅读全文
摘要:
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 keys greater than the original key in BST. 阅读全文