当前位置:网站首页>Niuke-top101-bm32
Niuke-top101-bm32
2022-07-26 04:36:00 【A fish that eats cats】
import java.util.*;
/* * public class TreeNode { * int val = 0; * TreeNode left = null; * TreeNode right = null; * } */
public class Solution {
/** * * @param t1 TreeNode class * @param t2 TreeNode class * @return TreeNode class */
public TreeNode mergeTrees (TreeNode t1, TreeNode t2) {
// write code here
if(t1 == null){
return t2;
}
if(t2 == null){
return t1;
}
TreeNode head = new TreeNode(t1.val + t2.val);
head.left = mergeTrees(t1.left, t2.left);
head.right = mergeTrees(t1.right, t2.right);
return head;
}
}
边栏推荐
- 【语义分割】2018-DeeplabV3+ ECCV
- View and modify the number of database connections
- Calculate the curvature of discrete points (matlab)
- An SQL server queries the latest records as of a certain date
- AWS Support Plan
- Js手写函数之节流防抖函数
- 嵌入式实操----基于RT1170 FreeRTOS实现CPU使用率统计(二十四)
- IEC61131 数据类型与 C#数据类型的对应
- [enterprise micro procedure]
- 二、国际知名项目-HelloWorld
猜你喜欢

2、 Internationally renowned project HelloWorld

qt编译报错整理及Remote模块下载

快恢复二极管工作原理及使用

青少年创客教育的创意设计原理

Postman 导入curl 、导出成curl、导出成对应语言代码

QT compilation error sorting and remote module Download

数组排序2

【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(八)

Use Baidu PaddlePaddle easydl to complete garbage classification

Is this my vs not connected to the database
随机推荐
Offline installation of idea plug-in (continuous update)
Add watermark to ffmpeg video
Chapter 3 how to use sourcetree to submit code
5、 Domain objects share data
Rotate array minimum number
2022 a.static query on tree (tree section)
1. Mx6u system migration-6-uboot graphical configuration
mongoDB为什么快
Postman 导入curl 、导出成curl、导出成对应语言代码
Yuansaka Lin wallpaper
Getting started with mongodb Basics
C language lseek() function: move the read and write location of the file
MySQL log classification: error log, binary log, query log, slow query log
Steam science education endows classroom teaching with creativity
UE4 靠近物体时显示文字,远离时文字消失
Use Baidu PaddlePaddle easydl to complete garbage classification
2022杭电多校 DOS Card(线段树)
What are the consequences and problems of computer system restoration
Face database collection summary
[uoj 429] runs (inclusive) + a little record about Lyndon tree and its application