小编imv*_*shi的帖子

链接列表 - 插入中间,链接新节点

查看底部的最后一个函数i_at().

#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#define nl printf("\n")
#define pf printf
#define si(a) scanf("%d",&a)
#define sc(a) scanf("%c",&a);
struct node{
    int val;
    struct node *next;
};
struct node *first,*last,*damn,*temp,*prev,*newnode;
void i_beg();
void i_end();
void display();
void del();
void i_at();
struct node *create(int);
main()
{
    int val,i,j; char key;val=1;
    while(val<6 && val>0){
        pf("\n1.Start \t2.End \t3.Display\t4.Delete\t5.Insert\t6.Exit\n------------------------------------------------\n");
        si(val);
        if(val==6)exit(0);
        else{
            switch(val){
                case 1: i_beg(); break;
                case 2: i_end(); break;
                case 3: display();break;
                case 4: del(); break;
                case 5: i_at();break;
                case 6: exit(0);break; …
Run Code Online (Sandbox Code Playgroud)

c linked-list nodes

3
推荐指数
1
解决办法
163
查看次数

标签 统计

c ×1

linked-list ×1

nodes ×1