📄 str.h
字号:
#include "stdafx.h"
#include <math.h>
#include <iostream>
#include <string>
using namespace std;
typedef struct Node{
int data;
struct Node *next;
}Lnode,*LinkList;
typedef struct NodeList
{
Lnode *data;
struct NodeList *next;
}Lnodelist,*LinkList2;
//求单链表的表长
long Length_linklist(LinkList L)
{
Lnode *p;
int j;
p=L;
j=0;
while(p->next != NULL)
{p=p->next;
j++;
}
return j;
}
//从单链表中查找 第i 个数据
int Get_ListData(LinkList L,int i)
{
Lnode *p;
int j=0;
p=L;
for(j=0; j<=i;j++)
{
if(p!=NULL)
p=p->next;
else
break;
}
if(j<=i)
return -1; //此时为不存在的索引
else
return p->data; //返回正确的data
}
int Get_Data(LinkList2 L,int i,int j)
{
//从该结构中得到与2维数组对应的索引的 数据data
return 1;
}
Lnodelist *Create2list(int n)
{
//创建一个 n*n 的2维 单链表 复合结构
Lnodelist *list2;
return list2;
}
void Set_Data(LinkList2 L,int i,int j)
{
//在该结构中设计与2维数组索引对应的 数据
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -