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

📄 linkedlistinsert.cpp

📁 Data Abstraction & Problem Solving with C++源码
💻 CPP
字号:
#include "ListException.h"#include <iostream>using namespace std;typedef desired-item-type ItemType;struct Node{  ItemType item;   Node *next;}; // end structvoid linkedListInsert(Node *& headPtr,                      ListItemType newItem){   if ((headPtr == NULL) || (newItem < headPtr->item))   {  // base case: insert newItem at beginning      // of the linked list to which headPtr points      Node *newPtr = new Node;      newPtr->item = newItem;      newPtr->next = headPtr;      headPtr = newPtr;   }   else      linkedListInsert(headPtr->next,newItem);}  // end linkedListInsert

⌨️ 快捷键说明

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