Leetcode 572:另一个树的子树 题目描述 给定两个非空二叉树 s 和 t,检验 s 中是否包含和 t 具有相同结构和节点值的子树。s 的一个子树包括 s 的一个节点和这个节点的所有子孙。s 也可以看做它自身的一棵子树。 示例 解题…
标签:算法
[leetcode]题目解析(190524)
valid sudoku 题目描述 Determine if a Sudoku is valid, according to: Sudoku Puzzles – The Rules.The Sudoku board could …
[Leetcode]merge sorted array
merge sorted array 题目描述 Given two sorted integer arrays A and B, merge B into A as one sorted array.Note: You may assum…
[leetcode]populating next right pointers in each node
题目描述 题目描述 Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Popul…
[Leetcode]copy list with random pointer
题目描述 A linked list is given such that each node contains an additional random pointer which could point to any node in t…
leetcode之single-number-ii、Gas station、word break
single-number-ii Given an array of integers, every element appears three times except for one. Find that single one. Not…
算法笔记之线性规划网络流问题(5)
最大收益问题 问题分析 经过分析,又根据最大流最小割定理,最大流的流值等于最小割容量。即:实验方案净收益=所有实验项目收益-最大流值。所以只需要求出最大流值即可、 算法设计 构建网络。根据输入的数据,添加源点和汇点,从源点s到每个实验项目E…