当前位置:网站首页>572. subtree of another tree
572. subtree of another tree
2022-06-11 06:29:00 【Saucey_ six】
subject :
Ideas : recursive
Code :
var isSubtree = function (s, t) {
if (!s) return false
if (isSub(s, t)) return true
return isSubtree(s.left, t) || isSubtree(s.right, t)
function isSub(treeS, treeT) {
if (!treeS && !treeT) return true
if (!treeS || !treeT) return false
if (treeT.val !== treeS.val) return false
return isSub(treeS.left, treeT.left) && isSub(treeS.right, treeT.right)
}
};
(ps: The fourth day )
边栏推荐
- Handwriting promise [03] - realize multiple calls and chain calls of then method
- go的fmt包使用和字符串的格式化
- Handwriting promise [02] - asynchronous logic implementation
- CCF 2013 12-5 I‘m stuck
- Resolve typeerror: ctx injections. tableRoot.$ scopedSlots[ctx.props.column.slot] is not a function
- Review XML and JSON
- arguments......
- NPM upgrade: unable to load file c:\users\administrator\appdata\roaming\npm\npm-upgrade ps1
- Why is it that the live video of the devices connected to easygbs suddenly cannot be played? Insufficient database read / write
- Solve the problem that ffmpeg obtains aac audio files with incorrect duration
猜你喜欢
随机推荐
A collection of problems on improving working frequency and reducing power consumption in FPGA design
Vulnhub's breach1.0 range exercise
Why is it that the live video of the devices connected to easygbs suddenly cannot be played? Insufficient database read / write
Sharing of personal common software and browser plug-ins
Simple understanding of XML and JSON
FPGA设计——乒乓操作实现与modelsim仿真
Autojs, read one line, delete one line, and stop scripts other than your own
100. 相同的树
MATLAB realizes mean filtering and FPGA for comparison, and uses Modelsim waveform simulation
Array de duplication....
563. 二叉树的坡度
懒加载,预加载
Topic collection of FIFO minimum depth calculation
个人常用软件及浏览器插件分享
Shandong University machine learning final 2021
解决ffmpeg獲取AAC音頻文件duration不准
JS two methods to determine whether there are duplicate values in the array
FPGA interview notes (II) -- synchronous asynchronous D flip-flop, static and dynamic timing analysis, frequency division design, retiming
山东大学项目实训之examineListActivity
2021-03-25

![Chapter 1 of machine learning [series] linear regression model](/img/e2/1f092d409cb57130125b0d59c8fd27.jpg)







