摘要: 输入两棵二叉树A,B,判断B是不是A的子结构。(ps:我们约定空树不是任意一个树的子结构) 阅读全文
posted @ 2019-04-16 22:20 yjxyy 阅读(120) 评论(0) 推荐(0) 编辑
摘要: You're given strings `J` representing the types of stones that are jewels, and `S`representing the stones you have. Each character in `S` is a type of stone you have. You want to know how many of the stones you have are also jewels. The letters in `J` are guaranteed distinct, and all characters in `J` and `S` are letters. Letters are case sensitive, so `"a"` is considered a different type of stone from `"A"`. 阅读全文
posted @ 2019-04-16 22:18 yjxyy 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 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 not. 阅读全文
posted @ 2019-04-16 22:16 yjxyy 阅读(237) 评论(0) 推荐(0) 编辑
摘要: Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order, too. You need to find the shortest such subarray and output its length. 阅读全文
posted @ 2019-04-16 22:14 yjxyy 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 同步器是用来构建锁和其他同步组件的基础框架,它的实现主要依赖一个int成员变量来表示同步状态以及通过一个FIFO队列构成等待队列 阅读全文
posted @ 2019-04-15 19:50 yjxyy 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 对象的内存分配,往大方向讲,就是在**堆上进行分配**,对象主要分配在**新生代的Eden区上**,如果启用了**本地线程分配缓冲**,将按线程优先在TLAB上进行分配,少数情况下也会直接分配在老年代。 阅读全文
posted @ 2019-04-15 19:39 yjxyy 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 输入两个单调递增的链表,输出两个链表合成后的链表,当然我们需要合成后的链表满足单调不减规则。 阅读全文
posted @ 2019-04-15 19:26 yjxyy 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 输入一个链表,反转链表后,输出新链表的表头。 阅读全文
posted @ 2019-04-15 19:24 yjxyy 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 输入一个链表,输出该链表中倒数第k个结点。 阅读全文
posted @ 2019-04-15 19:08 yjxyy 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 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. 阅读全文
posted @ 2019-04-15 19:04 yjxyy 阅读(183) 评论(0) 推荐(0) 编辑