开发者

Using a STL container to store Treeview data

i'm looking for a C++ STL contai开发者_Python百科ner class to keep the treeview parent/child node strings but when a node is deleted from tree control, do i have iterate through all the container class elements to find that selected one and then delete it? what's the best to keep the data updated in container?


use STL set, which is efficient in operations like insert and delete in O(log n) time.

e.g.

set<TreeNode> a;
a.insert(aTreeNode); // insert
a.erase(aTreeNode); // delete
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜