[Stanford Algorithms: Design and Analysis, Part 2] c22- Kruskal's MST


 

 

// CPP program to demonstrate use of std::map
#include <bits/stdc++.h>

int main()
{
std::shared_ptr<char> pA(new char('A'));
std::shared_ptr<char> pB(new char('B'));
std::shared_ptr<char> pC(pA);

std::cout << pC.use_count() << std::endl; //2

std::cout << *pA << std::endl;//A

pA = pB;

std::cout << *pA << std::endl;//B

std::cout << pC.use_count() << std::endl; //1

}

 

 


 

 

 

 

posted @ 2019-03-21 10:47  ecoflex  阅读(143)  评论(0编辑  收藏  举报