⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c04p193.txt

📁 Data Abstraction & Problem Solving with C++源码
💻 TXT
字号:
bool List::isEmpty() const{   return size == 0;}  // end isEmptyint List::getLength() const{   return size;}  // end getLengthList::ListNode *List::find(int index) const// --------------------------------------------------// Locates a specified node in a linked list.// Precondition: index is the number of the// desired node.// Postcondition: Returns a pointer to the desired// node. If index < 1 or index > the number of// nodes in the list, returns NULL.// --------------------------------------------------{   if ( (index < 1) || (index > getLength()) )      return NULL;   else  // count from the beginning of the list   {  ListNode *cur = head;      for (int skip = 1; skip < index; ++skip)         cur = cur->next;      return cur;   }  // end if}  // end find

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -