int root = - 1 ; for ( int i = 0 ; i < n; i++) { if (fathers[i] == - 1 ) { root = i; } } 找到根结点
点赞 评论

相关推荐

02-22 21:16
已编辑
门头沟学院 运营
牛客928043833号:离了你谁还拿我当个宝
点赞 评论 收藏
分享
牛客网
牛客企业服务