本文整理汇总了C++中AvlTree::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ AvlTree::isEmpty方法的具体用法?C++ AvlTree::isEmpty怎么用?C++ AvlTree::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AvlTree
的用法示例。
在下文中一共展示了AvlTree::isEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: commonThreeWordPhrase
void commonThreeWordPhrase(string word, vector<string>&arr1, vector<string>&arr2, vector<string>&arr3, AvlTree& tree){
string concatenate = "";
if(tree.isEmpty() == true){
if(arr1.size() == 0 && arr2.size() == 0 && arr3.size() == 0)
arr1.push_back(word);
else if(arr1.size() == 1 && arr2.size() == 0 && arr3.size() == 0){
arr1.push_back(word);
arr2.push_back(word);
}else if (arr1.size() == 2 && arr2.size() == 1 && arr3.size() == 0){
arr1.push_back(word);
arr2.push_back(word);
arr3.push_back(word);
if(arr1.size() == 3){
for (int i = 0; i < arr1.size(); i++)
i == 0 ? concatenate = arr1[i] : concatenate = concatenate + " " + (string)arr1[i];
tree.insert(concatenate);
arr1.clear();
}
}
}else{
if(arr1.size()!= 3 && word.length() > 0)
arr1.push_back(word);
if(arr2.size() != 3 && word.length() > 0)
arr2.push_back(word);
if(arr3.size() != 3 && word.length() > 0)
arr3.push_back(word);
if(arr1.size() == 3) {
for (int i = 0; i < arr1.size(); i++)
i == 0 ? concatenate = arr1[i] : concatenate = concatenate + " " + (string)arr1[i];
tree.insert(concatenate);
arr1.clear();
}
if (arr2.size() == 3) {
for (int i = 0; i < arr2.size(); i++)
i == 0 ? concatenate = arr2[i] : concatenate = concatenate + " " + (string)arr2[i];
tree.insert(concatenate);
arr2.clear();
}
if (arr3.size() == 3) {
for (int i = 0; i < arr3.size(); i++)
i == 0 ? concatenate = arr3[i] : concatenate = concatenate + " " + (string)arr3[i];
tree.insert(concatenate);
arr3.clear();
}
}
}