博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
学习数据结构
阅读量:6975 次
发布时间:2019-06-27

本文共 834 字,大约阅读时间需要 2 分钟。

hot3.png

// ConsoleApplication3.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include 
#include
struct Node;typedef struct Node *ptrToNode;typedef ptrToNode List;typedef ptrToNode Position;typedef int Element;void insert(Element e, List list);void read(List list);struct Node{ Element e; Position next;};int main(){        List list = (List)malloc(sizeof(List)); list->next = NULL; list->e = -1; for (int i = 0; i < 10; i++) { Element e = i; insert(e,list); } read(list); scanf_s("");    return 0;}void insert(Element e, List list) { if (!list) { ferror; } Position temp = (Position)malloc(sizeof(Position)); temp->e = e; temp->next = list->next; list->next = temp;}void read(List list) { Position p = list->next; while (p) { printf("#%d", p->e); p = p->next; }}

转载于:https://my.oschina.net/furioussoul/blog/652458

你可能感兴趣的文章
Ubuntu 12.04 安装 VMware Tools 找不到linux-headers 问题
查看>>
TP5 Tree类无限极分类
查看>>
阶段性总结-贪心算法
查看>>
C++namespace
查看>>
小程序初体验:手把手教你写出第一个小程序(一)
查看>>
【翻译】数据库设计——范式
查看>>
C# 事件(Event)
查看>>
【算法】6西格玛
查看>>
ny8 一种排序 sort
查看>>
Staying on Track with Location Services--WWDC 2012 session 303
查看>>
前端开发利器,webStorm
查看>>
Java中final、finally、finalize的区别
查看>>
[Leetcode]695. Max Area of Island
查看>>
第一篇博客
查看>>
面向对象程序设计第二次作业
查看>>
Linux 典型应用之缓存服务
查看>>
Docker版本与安装介绍
查看>>
dzzoffice应用如何安装
查看>>
读《构建之法》阅读与思考
查看>>
折线分割平面
查看>>