当前位置:网站首页>Arbre intérieur maximal de l'anneau de base
Arbre intérieur maximal de l'anneau de base
2022-01-15 02:25:33 【Yan Wei, Digital Media Technology, Jiangnan University】
Un.、Propriétés de l'arbre introverti de l'anneau de base:
1.C'est une image,Au lieu d'un arbre
2.Les sorties de tous les noeuds sont1
3.Les noeuds à l'extérieur de l'anneau pointent vers les noeuds à l'intérieur de l'anneau
2.、Comment trouver l'arbre intérieur de l'anneau de base:
Tri topologique:Enregistrer la pénétration de tous les noeuds,Après Tri topologique,La pénétration est1Le noeud de est un noeud dans l'anneau.
Dans le Codeg[i]Représentanti->g[i]Un côté dirigé de
queue<int>q;
for(int i=0;i<n;++i){
if(degree[i]==0){
q.push(i);
}
}
while(!q.empty()){
int cur=q.front();
q.pop();
if(--degree[g[cur]]==0){
q.push(g[cur]);
}
}
Trois、Arbre à anneaux de base interne maximum:
Tous les degrés ne sont pas0Point,Vous pouvez trouver le plus grand anneau de base intérieur.
Attention pendant la traversée,Parce que tous les degrés sont1,Ainsi, la rencontre d'un noeud peut être réglée directement à0,Empêcher les traversées répétées.
for(int i=0;i<n;++i){
if(degree[i]==0){
continue;
}
degree[i]=0;
int max_ring_size=1;
for(int v=g[i];v!=i;v=g[v]){
++max_ring_size;
degree[v]=0;
}
ans=max(ans,max_ring_size);
}
版权声明
本文为[Yan Wei, Digital Media Technology, Jiangnan University]所创,转载请带上原文链接,感谢
https://chowdera.com/2022/01/202201080600041637.html
边栏推荐
- The world is always hostile to good people.
- Re regular matching findall (. +?) Match any content that conforms to a certain format (regular matching catch bullet screen)
- Android中的羊角符,面試看這個就够了
- 數據分析八大模型:OGSM模型
- La corne d'agneau d'Android, c'est assez pour l'interview
- Huit modèles d'analyse des données: modèle ogsm
- Exemple d'application de linq
- Utilisez S7. Net communication library
- Écrire La Bibliothèque de communication Modbus TCP
- Lire le profil INI
猜你喜欢
-
Utilisez S7. Net read Siemens 1500plc
-
Halcon joint C # Programming Experiment
-
Utiliser nmodbus4 pour lire les données à la fois RTU et TCP
-
Tiktok Data Analysis options Platform - tichoo Data
-
MySQL review: create tables, MySQL data types, primary key constraints, primary key
-
Linear Algebra: matrix review
-
Review of Linear Algebra: determinant
-
The digital RMB cross-border payment test has been continuously promoted, and mainland residents can also shop in Hong Kong in the future
-
Thesis classification and writing basis
-
YC Framework version update: v1.0 zero point two
随机推荐
- Analyse des données tichoo
- Tiktok data analysis platform
- Partage de l'industrie | tichoo Data to attend 2022 Overseas Short video Industry Summit
- [ticoo Information Station] tiktok and Cross - Border E - commerce Weekly Report
- Options d'analyse des données ticoo {infostation}
- Partage de l'industrie | Lu Shidong, PDG de tichoo Data Outlook Global Video e - commerce future Blueprint
- [ticoo Information Station]
- Noël Black Five
- YC Framework version update: v1.0 zero point two
- Lucene分词器
- Gbase 8A slow SQL optimization case
- 微服务系列--聊聊微服务治理中的一些感悟
- 线程池的经典应用场景
- [web security from getting started to giving up] 07_ Insecure file download and upload vulnerability
- 如何落地一款重试组件
- 一起聊聊设计原则
- 大话Redis系列--深入探讨多路复用(上)
- 大话Redis系列--实战案例总结(下)
- 大话Redis系列--实战案例总结(上)
- JVM系列 -- G1与低延迟垃圾收集器
- JVM系列 -- 深入剖析垃圾收集器
- JVM系列--内存回收
- JVM系列--对象内存分配技术分析
- JVM系列--虚拟机的内存管理
- 系统性能瓶颈排查技术总结
- 使用redis的scan指令详解
- 实战--分布式id发号器
- 分布式事务之超详细的Seata实践记录
- TCP time_wait
- IP数据报头部
- 最大基环内向树
- MySQL实战45讲 学习笔记(七)
- MySQL实战45讲 学习笔记(六)
- Android从零开始搭建MVVM架构(1)(1),kotlin匿名函数
- Android事件分发机制五:面试官你坐啊,安卓上机面试题
- There will be two different stages between the breakthrough of science and technology and its real transformation into an inclusive technology
- [leetcode] force deduction 200 Number of islands
- HashShuffleManager
- Altium Designer
- Android construit l'architecture mvvm à partir de zéro (1) (1), fonction anonyme kotlin