文章
11
粉丝
70
获赞
30
访问
13.3k
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
using namespace std;
#include <string.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <stdlib.h>
typedef struct Node {
    int Element; // 节点中的元素为整数类型
    struct Node* Next; // 指向下一个节点
}Node,*LinkList;
void Insert(LinkList& L,int e) {
    LinkList p = (Node*)malloc(sizeof(Node));
    p->Element = e;
    p->Next = L->Next;
    L->Next = p;
}
void Print(LinkList& L) {
    LinkList p = (Node*)malloc(sizeof(Node));
    p = L;
    while (p->Next != NULL) {
        p = p->Next;
        cout << p->Element << " ";
    }
}
void Reverse(LinkList& L) {
    //头插法
    LinkLi...
登录后发布评论
暂无评论,来抢沙发