课设:链表应用

这篇博客详细介绍了如何在课程设计中实现链表的基本操作,包括链表的创建、头插法和尾插法的元素插入、节点删除以及链表的遍历。通过这些操作,读者可以深入理解链表的数据结构及其应用。
摘要由CSDN通过智能技术生成

主要熟悉链表的创建、插入(头插和尾插)、删除。遍历操作

#include <iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
using namespace std;
const int N=220;
 
typedef struct node
{
    int   number;   //编号
    char name[40];   //姓名
    char tel[40];    //电话
    char email[40];    //电子邮箱
    node* next;
}Node,*pNode;
 
void  Query(pNode head,char *name)
{
    int f=0;
    pNode p=head->next;
    while(p!=0)
    {
        if(strcmp(p->name,name)==0)
        {
             cout<<p->number<<" "<<p->name<<" "<<p->tel<<" "<<p->email<<endl;
             f=1;
        }
        p=p->next;
    }
    if(f==0)
        cout<<"NOT FOUND!"<<endl;
}
void modify(pNode &head,char *name,char *info,char *change)
{
    pNode p=head->next;
    while(p!=0)
    {
        if(strcmp(p->name,name)=&#
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值