本文整理汇总了C++中BinaryTree::BalanceTree方法的典型用法代码示例。如果您正苦于以下问题:C++ BinaryTree::BalanceTree方法的具体用法?C++ BinaryTree::BalanceTree怎么用?C++ BinaryTree::BalanceTree使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinaryTree
的用法示例。
在下文中一共展示了BinaryTree::BalanceTree方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddIndexOnGenre_name
void Genres::AddIndexOnGenre_name()
{
BinaryTree<genresindex> index;
vector<Genre*> vecp;
_data.TreeToVectorPointers(vecp);
for(auto i=0;i<vecp.size();++i)
{
genresindex indice;
indice.key = &(vecp[i]->genre_name());
indice.pointers.push(vecp[i]);
try
{
index.push(indice);
}
catch (...)
{
index.get(indice).pointers.push(vecp[i]);
}
}
index.BalanceTree();
_indexes.push(std::move(index));
_IndexOnGenre_name = _indexes.size() - 1;
}
示例2: AddIndexOnTitle
void Films::AddIndexOnTitle()
{
BinaryTree<filmsindex> index;
vector<Film*> vecp;
_data.TreeToVectorPointers(vecp);
for(auto i=0;i<vecp.size();++i)
{
filmsindex indice;
indice.key = &(vecp[i]->title());
indice.pointers.push(vecp[i]);
try
{
index.push(indice);
}
catch(...)
{
index.get(indice).pointers.push(vecp[i]);
}
}
index.BalanceTree();
_indexes.push(std::move(index));
_IndexOnTitle = _indexes.size() -1;
}
示例3: AddIndexOnTelephone
void Users::AddIndexOnTelephone()
{
BinaryTree<usersindex> index;
vector<User*> vecp;
_data.TreeToVectorPointers(vecp);
for(auto i=0;i<vecp.size();++i)
{
usersindex indice;
indice.key = &(vecp[i]->FirstName());
indice.pointers.push(vecp[i]);
try
{
index.push(indice);
}
catch (...)
{
index.get(indice).pointers.push(vecp[i]);
}
}
index.BalanceTree();
_indexes.push(std::move(index));
_IndexOnTelephone = _indexes.size() - 1;
}
示例4: AddIndexOnBirthDate
void Actors::AddIndexOnBirthDate()
{
BinaryTree<actorsindex> index;
vector<Actor*> vecp;
_data.TreeToVectorPointers(vecp);
for(auto i=0;i<vecp.size();++i)
{
actorsindex indice;
indice.key = &(vecp[i]->BirthDate());
indice.pointers.push(vecp[i]);
try
{
index.push(indice);
}
catch (...)
{
index.get(indice).pointers.push(vecp[i]);
}
}
index.BalanceTree();
_indexes.push(std::move(index));
_IndexOnBirthDate = _indexes.size() - 1;
}