本文整理汇总了C++中DoublyLinkedList::append方法的典型用法代码示例。如果您正苦于以下问题:C++ DoublyLinkedList::append方法的具体用法?C++ DoublyLinkedList::append怎么用?C++ DoublyLinkedList::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DoublyLinkedList
的用法示例。
在下文中一共展示了DoublyLinkedList::append方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main() {
DoublyLinkedList<int> d;
d.append(7);
d.append(8);
d.append(9);
d.append(10);
d.insert(1,0);
d.insert(12,d.size());
d.insert(3,3);
d.print();
cout<<"Size = "<<d.size()<<"\n";
return 0;
}
示例2: invertirListaDoblementeEnlazada
//Metodo para invertir las notas en la estructura de lista doblemente enlazada.
void invertirListaDoblementeEnlazada(){
Nota temp;
for(int i=0 ; i<listaDoblementeEnlazada.length() ; i++){
temp = listaDoblementeEnlazada.remove(i);
pila.push(temp);
}
while(pila.length()!=0){
listaDoblementeEnlazada.append(pila.pop() );
}
}
示例3: shrink
void MarkedSpace::shrink()
{
// We record a temporary list of empties to avoid modifying m_blocks while iterating it.
DoublyLinkedList<MarkedBlock> empties;
BlockIterator end = m_blocks.end();
for (BlockIterator it = m_blocks.begin(); it != end; ++it) {
MarkedBlock* block = *it;
if (block->isEmpty()) {
SizeClass& sizeClass = sizeClassFor(block->cellSize());
sizeClass.blockList.remove(block);
sizeClass.nextBlock = sizeClass.blockList.head();
empties.append(block);
}
}
freeBlocks(empties);
ASSERT(empties.isEmpty());
}