本文整理汇总了C++中BinaryHeap::removeRoot方法的典型用法代码示例。如果您正苦于以下问题:C++ BinaryHeap::removeRoot方法的具体用法?C++ BinaryHeap::removeRoot怎么用?C++ BinaryHeap::removeRoot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinaryHeap
的用法示例。
在下文中一共展示了BinaryHeap::removeRoot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
cout << "[10] Pokaz zawartosc od konca" << endl;
cout << "[11] Koniec" << endl;
cin >> whichOption2;
switch (whichOption2)
{
case 1:
list.addElementToTheBeginning();
break;
case 2:
list.addElementToTheEnd();
break;
case 3:
list.addElementSomewhere();
break;
case 4:
list.removeFirstElement();
break;
case 5:
list.removeLastElement();
break;
case 6:
list.removeSomeElement();
break;
case 7:
list.findElement();
break;
case 8:
list.findElementValue();
break;
case 9:
cout << endl;
list.showContent();
cout << endl;
break;
case 10:
cout << endl;
list.showInverseContent();
cout << endl;
break;
case 11:
break;
default:
cout << "nie ma takiej opcji" << endl;
break;
}
} while (whichOption2 != 11);
break;
case 3:
int whichOption3;
do{
heap.draw();
cout << endl;
cout << "wybierz operacje: " << endl;
cout << "[1] Dodaj element" << endl;
cout << "[2] Usun korzen" << endl;
cout << "[3] Znajdz element" << endl;
cout << "[4] Koniec" << endl;
cin >> whichOption3;
switch (whichOption3)
{
case 1:
heap.addElement();
break;
case 2:
heap.removeRoot();
break;
case 3:
heap.findElement();
break;
case 4:
break;
default:
cout << "nie ma takiej opcji" << endl;
break;
}
} while (whichOption3 < 4);
case 4:
break;
break;
default:
cout << "nie ma takiej opcji" << endl;
break;
}
}while (whichStruct != 4);
system("PAUSE");
return 0;
}