Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC++shared_ptr and weak_ptrSingle-choice MCQ

What is the cycle problem that `std::weak_ptr` solves, and how does it solve it?

struct Node { std::shared_ptr<Node> next; std::shared_ptr<Node> prev; // <-- changing this };