摘要: 输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字,例如,如果输入如下4 X 4矩阵: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 则依次打印出数字1,2,3,4,8,12,16,15,14,13,9,5,6,7,11,10. 阅读全文
posted @ 2019-04-16 22:24 yjxyy 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 操作给定的二叉树,将其变换为源二叉树的镜像。 阅读全文
posted @ 2019-04-16 22:22 yjxyy 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 输入两棵二叉树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) 编辑