LeetCode刷题笔录 Same Tree

从无人机到机械臂:深入聊聊LQR和LQG在实际项目里的那些‘坑’与最佳实践 本文深入探讨了LQR和LQG在无人机和机械臂等实际项目中的应用挑战与最佳实践。从系统建模的妥协艺术到调参的系统化方法,再到离散化的细节处理,文章分享了工程实践中的宝贵经验。特别强调了如何应对传感器噪声、未建模动态等现实问题,并提供了实用的调试工具和诊断流程,帮助工程师避免常见陷阱,提升控制系统的稳定性和性能。 阅读详情

Given two binary trees, write a function to check if they are equal or not.

Two binary trees are considered equal if they are structurally identical and the nodes have the same value.

基本的递归。先比较当前node,再比较左子树和右子树



public class Solution {
    public boolean isSameTree(TreeNode p, TreeNode q) {
        if(p == null && q == null)
            return true;
        else if(p == null || q == null)
            return false;
        else if(p.val != q.val)
            return false;
        else return isSameTree(p.left, q.left) && isSameTree(p.right, q.right);
    }
}


duilib 之 事件--bubbled冒泡事件应用、通用点击事件、进入离开事件、XML样式中直接添加事件 1. box 绑定点击事件 ui::Box *pSmallVideoBox = (ui::Box*)FindControl(L"rightBox"); if (pSmallVideoBox) { auto SwitchVideo = [this](ui::EventArgs* param){ m_bSecScreenIsScale = m_bMainScre... 阅读详情

相关推荐

msf使用木马控制android手机

使用msfvenom生成木马控制手机

my_name_is_sy的博客 3522

LeetCode刷题笔录 Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo

likecool21的专栏 1万+

NVIDIA DGX Spark实战指南:从开箱到AI模型高效部署

本文详细介绍了NVIDIA DGX Spark的开箱体验、硬件架构及AI模型高效部署实战指南。从1 PetaFLOP算力的迷你设备到Grace Blackwell超级芯片的深度解析,再到五分钟快速上手指南和大模型部署技巧,帮助开发者充分利用这款全球最小AI超级计算机的性能优势。

weixin_29239279的博客 1365

LeetCode刷题笔录 Two Sum

Two Sum Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the

likecool21的专栏 1万+

Zephyr 开发必备技能:一文搞懂 west manifest

本文深入解析Zephyr项目的westmanifest工具与Manifest文件管理,从基础概念到高级应用。文章首先介绍westmanifest作为Zephyr模块化架构的核心工具,负责管理west.yml文件中的模块信息、Git地址及版本控制。随后详细讲解Manifest文件的基本结构、字段含义,以及westmanifest子命令的使用方法,包括查看内容、冻结版本、验证文件等操作。文章还探讨了Manifest的导入继承机制和在团队协作中的版本管理策略,并给出常见问题排查技巧。最后强调Manifest文件作

hemoparrot的专栏 1256

CAPL 中的变量类型详解与应用

CAPL 中的变量类型详解与应用

qq_42268594的博客 1448

LeetCode刷题笔录 Validate Binary Search Tree

Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key.Th

likecool21的专栏 6928

图解“交易·支付·清结算·账务”全局

这个过程大致是这样的,用户先到平台选择喜欢的“餐品”,然后“下单”,生成交易“账单”,用户选择支付方式进行“支付”,支付成功后平台要履行承诺把餐送到,“履约”完成以后平台就开始进行各方利益的“清分”,计算清楚应给谁多少钱,并“记账”,最后将款项“结算”给商家,这个过程如图7所示。交易系统请求订单系统创建订单,因为不清楚平台和商家之间的清结算协议,所以暂且认为所有优惠由平台提供给用户,后续平台再基于协议跟商家之间做优惠的分摊,将上述商品、优惠、计价等信息集成到一起,就得到了完成的订单信息了,如表4所示。

wjianwei666的专栏 1万+

Stanford Algorithms学习:Clustering 2

这是紧接上面的一道题,比较有趣 Question 2 In this question your task is again to run the clustering algorithm from lecture, but on a MUCH bigger graph. So big, in fact, that the distances (i.e., edge costs

likecool21的专栏 2567

CAD图纸智能搜索三大突破:图纸秒搜技术、相似度匹配与AI语义搜索

CAD图纸作为核心资产,长期面临管理难题:传统全文检索需逐张打开图纸人工查找,效率低下;相似图纸匹配依赖人工比对,误差率高;非专业人员难以通过模糊描述精准定位图纸。针对这些问题,唯杰地图推出三项智能解决方案:一是基于现代化索引引擎的​​全文搜索​​,支持秒级检索图纸内的文字、图层、块名称等,并可多条件组合查询;二是​​相似度搜索​​,通过SIFT算法和深度学习提取几何特征与拓扑结构,实现高精度匹配;三是​​AI语义搜索​​,利用大模型解析自然语言指令(如“查找半径为10的红色圆”),直接定位目标图形。

vjmap的博客 1868

HyperLedger Fabric实战(一):基础环境构建

简介 本文将介绍从一台裸机上面如何构建出一个可用的Fabric网络(单机版,非测试网络)。 基础环境构建 Fabric组件安装

yindarui 1万+

Stanford Algorithms学习:Clustering

第二周的第一个编程作业,是利用贪婪算法来实现一个clustering的问题,和ML里学的unsupervised learning差不多。 Question 1 In this programming problem and the next you'll code up the clustering algorithm from lecture for computing a

likecool21的专栏 2507

YOLO十年演进:从CNN到Transformer再到MoE,我看懂了2026年目标检测的落地风向标

技术永远是为业务服务的,能解决真实问题的技术,才是有价值的。YOLO的十年演进,从CNN到Transformer再到MoE,从来都不是学术上的炫技,而是一步一步解决工业落地的痛点:从让实时检测成为可能,到解决复杂场景的漏检误检,再到打破精度和算力的死局,每一步都踩在了工业落地的真实需求上。很多新入行的朋友,总喜欢追新,今天换Transformer,明天堆MoE,觉得模型越新、参数越大,就越厉害。

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 748

LeetCode 刷题笔录 Add Two Numbers

You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link

likecool21的专栏 1806

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

LeetCode刷题笔录Edit Distance

Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have the following 3 operations permitted on a word:

likecool21的专栏 1296

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

LeetCode刷题笔录Minimum Depth of Binary Tree

Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.

likecool21的专栏 1109

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

LeetCode刷题笔录 Pascal's Triangle II

Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3,3,1]. Note: Could you optimize your algorithm to use only O(k) extra space? 这题比较简单

likecool21的专栏 1043

LeetCode刷题笔录Unique Binary Search Trees

这里有个讲解(印度人口音真难懂)

likecool21的专栏 1043

LeetCode刷题笔录Container With Most Water

Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Fin

likecool21的专栏 1001

LeetCode刷题笔录 Reverse Integer

Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 随手写的一个,正常的读出每一位的数字然后反序: import java.lang.Math; public class Solution { public int revers

likecool21的专栏 941

LeetCode刷题笔录Sum Root to Leaf Numbers

Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 which represents the number 123. Find the tota

likecool21的专栏 878

LeetCode刷题笔录Symmetric Tree

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \ 3 4 4 3 But the f

likecool21的专栏 865

LeetCode刷题笔录Convert Sorted Array to Balanced Binary Search Tree

Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 这题可以kan'chu'lai

likecool21的专栏 855

LeetCode 面试经典 150_多维动态规划_交错字符串(97_C++_中等)

LeetCode 面试经典 150_多维动态规划_交错字符串(97_C++_中等) 题目描述: 给定三个字符串 s1、s2、s3,请你帮忙验证 s3 是否是由 s1 和 s2 交错 组成的。 两个字符串 s 和 t 交错 的定义与过程如下,其中每个字符串都会被分割成若干 非空 子字符串: - s = s1 + s2 + ... + sn - t = t1 + t2 + ... + tm - |n - m| <= 1 - 交错 是 s1 + t

huayimenghan的博客 207

LeetCode Hot 100 二叉树专题(二)3 题(Java)

本篇文章共 3 题:543. 二叉树的直径、102. 二叉树的层序遍历、108. 将有序数组转换为二叉搜索树。 每道题都统一按「① 题目分析 & 解题思路 → ② 常见解法(附代码)及讲解 → ③ 知识点总结」的顺序组织;代码使用 Java 编写,节点定义沿用 LeetCode 默认的 TreeNode。

2401_88612756的博客 365

LeetCode 每日一题 2026/11/2-2026/11/8

记录了初步解题思路 以及本地实现代码;并不一定为最优 也希望大家能一起探讨 一起进步

AlphaTao的博客 175
上一篇: LeetCode刷题笔录 Maximum Depth of Binary Tree
下一篇: LeetCode刷题笔录Unique Binary Search Trees
likecool21
博客等级 码龄14年 14粉丝 123原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值