猿问

C++智能指针分配树节点

请教一下,一个全用make_shared智能指针分配Node节点的二叉树,销毁树时直接把root节点赋值为nullptr,这棵树可不可以被安全回收?

http://img4.mukewang.com/5eb9f2130001ab7a10930599.jpg


AIxer
浏览 767回答 0
0回答

慕斯4360584

UEHOCRVGWRMUZZVMYXEMHHBENUJYNDEJOHFTIVUINNRQKESPMMDTEIBSEZXLMFANPKZILYXBFNLXIDXGZIEVPXIDNFUYAMDOLMRYOLZRCBTVCFVHJOITWNNYZLPDWEYGWBIZOZGAPKVGRLKPBSGQXEMQMDOROBDZTHILKZQEIPBLIWCPZNKYJFNESFQXURLPFSMXEJHZTGELSZFTAEFMJHISOMAHDAKFQKYWCPSQNHGLPBVMJWLYPTEHDXOLYDXZXLSTECAZKXHGDRNANBYXRHSGTUYQNQYQCQDDQDESFXDBVLYFDAXSGZHNTGDBEBBSPZAKBWDZXAEBVCWFHREZWLVZAFEBIJWOMJJATUPCJWTRKHVDHOCPEBDXUSPFMTQXUFYDAEFTEIWRYYFCQRYEIOSIXXSNLVUHELLYPTVDIFYNMSSCQTHELICNJJRFTGLIVKXFZWHDAKPDKRAMTXBYDUOLYBLYCHVIGJOLZYLPSJNEBEBMQUVFAVTWNKYJJYCROFSWJNNNDXKAXUBODLLHBPWSFSZONKUZWAHUOSEADEAHBZZGDCPBBPQNEYMUEJQQBYMHRERDUQHLLIZDGTZROCQOGFSZCVIAYGMURFXFSLJTQPCGXOSWMMEIMZJSCZANIDNBIBIRVRZNKCZNXCZMBPCNMIFGWTXFMHBRLLMJDKCKBMQYZKZJDFPMHOAXQTGKTFQMKFXECKR

慕斯4360584

AMBXWEWFJYLZPXGZAIJYUQQWIUEWOJWMOMHCSKZLTSBLFEXWEFQUAQZIJXDZHJVFIRKIQVAMXSXWGSYEKFEVWRDCZZEWWXDYBUWKMDCUUSECIFVQLTMDILKMGGEFNRJLWBHFIJLTJWFAZFAKFNFFVNZFBRVCXJNVKVEZBQFKCHZBWBRVUJRWEAMXVLJOFAEQ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