📄 clist.h
字号:
template<class T>
int CircularList<T>::Search(const T& x) const
{// Locate x in a circular list with head node.
ChainNode<T> *current = first->link;
int index = 1; // index of current
first->data = x; // put x in head node
// search for x
while (current->data != x) {
current = current->link);
index++;
}
// are we at head?
return ((current == first) ? 0 : index);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -