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

📄 node.h

📁 对链表进行排序 应用了多种排序方法 对其进行比较 有自己的详细的时间函数
💻 H
字号:

#ifndef NODE
#define NODE
using namespace std;
struct Node
{
  Node* next;
  int data;
};
typedef struct Node* pNode;
pNode sCreate(int array[] , int len ) 
{
       int i= 1 ; 
       pNode pNewNode,pHead; 
       pNewNode = new Node ; 
       pHead = pNewNode ; 
       pNewNode->data = array[0] ;
       pNewNode->next = NULL ; 
       while( i <=len ) 
       { 
             pNewNode->next = new Node; 
             pNewNode = pNewNode->next ; 
             pNewNode->data = array[ i ] ; 
             pNewNode->next = NULL ; i++ ; 
       }
       return pHead ;
}
 
void sPrint(pNode pList) 
{ 
     while(pList!= NULL) 
     { 
        cout<< pList->data <<endl; 
        pList = pList->next ; 
     } 
     cout<< "now null" <<endl; 
}
pNode Locate(pNode pList,int n)
{
  pNode p=pList;
   for(int i=0;i<=n;i++)
     p=p->next;
     
   return p;
}
     
#endif 

⌨️ 快捷键说明

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