1 | 在本问题中, 树指的是一个连通且无环的无向图。 |
并查集
首先初始化并查集,然后遍历边,
- 如果一条边的两个节点属于不同的集合,那么这两个边是不会构成环路的
- 否则加入这一条边将会构成环路
1 | class Solution { |
1 | class Solution { |
1 | 在本问题中, 树指的是一个连通且无环的无向图。 |
首先初始化并查集,然后遍历边,
1 | class Solution { |
1 | class Solution { |
tag:
缺失模块。
1、请确保node版本大于6.2
2、在博客根目录(注意不是yilia根目录)执行以下命令:
npm i hexo-generator-json-content --save
3、在根目录_config.yml里添加配置:
jsonContent:
meta: false
pages: false
posts:
title: true
date: true
path: true
text: false
raw: false
content: false
slug: false
updated: false
comments: false
link: false
permalink: false
excerpt: false
categories: false
tags: true