📄 node.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 + -