Don't waste a time on studies of this incorrect program behaviour. The fatal defect of your class Node manipulations approach is that std::vector is an intrusive container. It has its own copies of all elements. In the function Bi_tree you assign node addresses and manipulate with vector contents at the same time. The std::vector is a dynamic structure, all pointers to its elements are valid until you pop/push elements. So all links in your "tree" nodes are invalid.
Can you explain what for are you using std::vector at all? Build dynamic binary tree from the scratch w/o these incorrect and unnecessary vector manipulations.
ArkM
Postaholic
2,001 posts since Jul 2008
Reputation Points: 1,234
Solved Threads: 348
ArkM
Postaholic
2,001 posts since Jul 2008
Reputation Points: 1,234
Solved Threads: 348