3.9Code

基于顺序存储结构的图书信息表的图书去重 

#include<iostream>
#include<stdlib.h>
#include<string.h>

typedef int status;

#define OK 1

using namespace std;

typedef struct{
	char no[50];
	char name[50];
	float price;
}Book;

typedef struct{
	Book* elem;
	int len;
}SqList;

status InitList(SqList* L,int n){
	L->elem=(Book*)malloc((n+5)*sizeof(Book));
	if(!L->elem) exit(-1);
	L->len=0;
	return OK;
}

status CreateList(SqList* L,int n){
	for(int i=0;i<n;i++){
		bool flag=true;
		Book b;
		cin>>b.no>>b.name>>b.price;
		for(int j=0;j<L->len;j++){
			if(!strcmp(b.no,L->elem[j].no)){
				flag=false;
				break;	
			}
		}
		if(flag){
			L->elem[L->len]=b;
			L->len++;
		}
	
	}
	return OK;
}


void PrintList(SqList* L){
	printf("%d\n",L->len);
	for(int i=0;i<L->len;i++){
		printf("%s %s %.2f\n",L->elem[i].no,L->elem[i].name,L->elem[i].price);
	}
}

int main(){
	SqList L;
	int n=0;
	cin>>n; //图书数 
	InitList(&L,n);
	CreateList(&L,n);
	PrintList(&L); 
	return 0;
}



终于开链表了开链表了T_T

基于链式存储结构的图书信息表的创建和输出

#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<iomanip>

typedef int status;

#define OK 1

using namespace std;

typedef struct{
	string no;
	string name;
	float price;
}Book;

typedef struct LNode{
	Book data;
	struct LNode* next;
}LNode,*LinkList;     //这样typedef,可以在后期比较方便地创建指向链表结点的指针 

void InitList(LinkList& L){
	L=new LNode;
	L->next=NULL;
}

//创建链表(含头结点),顺便返回链表长度 
int CreateList(LinkList& L){
	string no,name;
	float price;
	LinkList r=L;
	LinkList p;
	int elemCnt=0;
	while(1){
		//后插法创建链表
		cin>>no>>name>>price;
		if(no=="0" && name=="0" && price==0.0)
			break;
		else{
			p=new LNode;
			p->data.no=no;
			p->data.name=name;
			p->data.price=price;
			p->next=NULL;
			r->next=p;
			r=p;
			elemCnt++;
		} 
	} 
	return elemCnt;
}

void PrintList(LinkList& L,int n){
	LinkList p=L->next;
	cout<<n<<endl;
	while(p){
		cout<<fixed<<setprecision(2);
		cout<<p->data.no<<" "<<p->data.name<<" "<<p->data.price<<endl;
		p=p->next;
	}
	
}

int main(){
	LinkList L;
	int n=0;
	InitList(L);
	n=CreateList(L);
	PrintList(L,n);
	return 0;
} 

知识点

cout<<fixed<<setprecision(2);

需要添加头文件iomanip

这个用于精度控制(不然如果用%.2f,C和C++风格字符串混在一起也太乱糟了)

(顺便,C中其实是没有string的,如果定义了string,再用printf输出的话,要.c_str() )

基于链式存储结构的图书信息表的排序

#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<iomanip>

typedef int status;

#define OK 1

using namespace std;

typedef struct{
	string no;
	string name;
	float price;
}Book;

typedef struct LNode{
	Book data;
	struct LNode* next;
}LNode,*LinkList;

void InitList(LinkList& L){
	L=new LNode;
	L->next=NULL;
}

int CreateList(LinkList& L){
	string no,name;
	float price;
	LinkList r,p;
	r=L;
	int len=0;
	while(1){
		cin>>no>>name>>price;
		if(no=="0" && name=="0" && price==0.0)
			break;
		p=new LNode; //不要漏掉! 
		p->data.no=no;
		p->data.name=name;
		p->data.price=price;
		p->next=NULL;
		r->next=p;
		r=p;
		len++;
	}
	return len;
}

//排序 
void SortList(LinkList& L,int n){
	LinkList p;
	for(int i=0;i<n-1;i++){
		p=L->next;
		int j=0;
		while(p && j<n-1-i){
			if(p->data.price<p->next->data.price){
				Book b=p->data;
				p->data=p->next->data;
				p->next->data=b;
			}
			p=p->next;
			j++;
		}
	}
	
} 

void PrintList(LinkList& L){
	LinkList p=L->next;
	while(p){
		cout<<fixed<<setprecision(2);
		cout<<p->data.no<<" "<<p->data.name<<" "<<p->data.price<<endl;
		p=p->next;
	}
}

int main(){
	LinkList L;
	InitList(L);
	int len=CreateList(L);
	SortList(L,len);
	PrintList(L); 
}

知识点

对于链表的冒泡排序:(在创建链表时顺便就得到了链表长度,不用再额外遍历一遍了)

另:对定义链表的语句理解:

之后写LinkList L,L就是一个LinkList类型的指针,相当于一个指向链表结点的指针,包括在遍历时用到的辅助指针p等,都是这个类型的。

若想往结点里存数据,那么就先要为它开辟空间,所以常有这样的定义语句:

LinkList p;
p=new LNode;

基于链式存储结构的图书信息表的修改 

#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<iomanip>

typedef int status;

#define OK 1

using namespace std;

typedef struct{
	string no;
	string name;
	float price;
}Book;

typedef struct LNode{
	Book data;
	struct LNode* next;
}LNode,*LinkList;

void InitList(LinkList& L){
	L=new LNode;
	L->next=NULL;
}

int CreateList(LinkList& L,float &sum){
	string no,name;
	float price;
	LinkList r,p;
	r=L;
	int len=0;
	while(1){
		cin>>no>>name>>price;
		if(no=="0" && name=="0" && price==0.0)
			break;
		p=new LNode; //不要漏掉! 
		p->data.no=no;
		p->data.name=name;
		p->data.price=price;
		p->next=NULL;
		r->next=p;
		r=p;
		len++;
		sum+=price;
	}
	return len;
}

void ModifyList(LinkList& L,float avg){
	LinkList p=L->next;
	while(p){
		if(p->data.price<avg)
			p->data.price*=1.2;
		else
			p->data.price*=1.1;
		p=p->next;
	}
} 

void PrintList(LinkList& L){
	LinkList p=L->next;
	while(p){
		cout<<fixed<<setprecision(2);
		cout<<p->data.no<<" "<<p->data.name<<" "<<p->data.price<<endl;
		p=p->next;
	}
}

int main(){
	LinkList L;
	InitList(L);
	float sum=0.0;
	int len=CreateList(L,sum);
	float avg=sum/(float)len;
	cout<<fixed<<setprecision(2);
	cout<<avg<<endl;
	ModifyList(L,avg);
	PrintList(L); 
}

基于链式存储结构的图书信息表的逆序存储(链表逆序就用头插法实现即可,很简单)

#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<iomanip>

typedef int status;

#define OK 1

using namespace std;

typedef struct{
	string no;
	string name;
	float price;
}Book;

typedef struct LNode{
	Book data;
	struct LNode* next;
}LNode,*LinkList;

void InitList(LinkList& L){
	L=new LNode;
	L->next=NULL;
}

void CreateList(LinkList& L){
	int n;
	cin>>n; //链表长度 
	string no,name;
	float price;
	LinkList r,p;
	int cnt=0;
	while(cnt<n){
		cin>>no>>name>>price;
		p=new LNode; //不要漏掉! 
		p->data.no=no;
		p->data.name=name;
		p->data.price=price;
		p->next=NULL;
		
		//头插法实现逆序存储
		r=L->next;
		L->next=p;
		p->next=r; 
		
		cnt++;
	}
}


void PrintList(LinkList& L){
	LinkList p=L->next;
	while(p){
		cout<<fixed<<setprecision(2);
		cout<<p->data.no<<" "<<p->data.name<<" "<<p->data.price<<endl;
		p=p->next;
	}
}

int main(){
	LinkList L;
	InitList(L);
	float sum=0.0;
	CreateList(L);
	PrintList(L); 
}

查找最贵图书

#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<iomanip>

typedef int status;

#define OK 1

using namespace std;

typedef struct{
	string no;
	string name;
	float price;
}Book;

typedef struct LNode{
	Book data;
	struct LNode* next;
}LNode,*LinkList;

void InitList(LinkList& L){
	L=new LNode;
	L->next=NULL;
}

//返回最高图书价格 
float CreateList(LinkList& L){
	int n;
	cin>>n; //链表长度 
	string no,name;
	float price;
	float max=0.0; 
	LinkList r,p;
	r=L; //等于L比较好,如果等于L->next,之后会出现r=p->next的情况,这时候r的next就不太好了 
	int cnt=0;
	while(cnt<n){
		cin>>no>>name>>price;
		p=new LNode; //不要漏掉! 
		p->data.no=no;
		p->data.name=name;
		p->data.price=price;
		p->next=NULL;
		if(price>max)
			max=price;
		r->next=p;
		r=p;
		
		cnt++;
	}
	return max;
}

//返回最贵图书的数量 
int TraverseList(LinkList&L,float max){
	LinkList p=L->next;
	int cnt=0;
	while(p){
		if(p->data.price==max)
			cnt++; 
		p=p->next;
	}
	return cnt;
}

void PrintList(LinkList& L,float max){
	LinkList p=L->next;
	while(p){
		cout<<fixed<<setprecision(2);
		if(p->data.price==max){
			cout<<p->data.no<<" "<<p->data.name<<" "<<p->data.price<<endl;
		}
	
		p=p->next;
	}
}

int main(){
	LinkList L;
	InitList(L);
	float max=CreateList(L);
	cout<<TraverseList(L,max)<<endl;
	PrintList(L,max); 
}

查找最爱图书(同顺序表,用一个数组存储待查序列,代码写的比较乱功能封装的也不好,摆烂..)

#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<iomanip>

typedef int status;

#define OK 1

using namespace std;

typedef struct{
	string no;
	string name;
	float price;
}Book;

typedef struct LNode{
	Book data;
	struct LNode* next;
}LNode,*LinkList;

void InitList(LinkList& L){
	L=new LNode;
	L->next=NULL;
}

//返回最高图书价格 
void CreateList(LinkList& L){
	int n;
	cin>>n; //链表长度 
	string no,name;
	float price;
	LinkList r,p;
	r=L; //等于L比较好,如果等于L->next,之后会出现r=p->next的情况,这时候r的next就不太好了 
	int cnt=0;
	while(cnt<n){
		cin>>no>>name>>price;
		p=new LNode; //不要漏掉! 
		p->data.no=no;
		p->data.name=name;
		p->data.price=price;
		p->next=NULL;
		r->next=p;
		r=p;
		
		cnt++;
	}
}

//返回最爱图书的数量 
int TraverseList(LinkList&L,string love){
	LinkList p=L->next;
	int cnt=0;
	while(p){
		if(p->data.name==love)
			cnt++; 
		p=p->next;
	}
	return cnt;
}

void PrintList(LinkList& L,string love){
	LinkList p=L->next;
	while(p){
		cout<<fixed<<setprecision(2);
		if(p->data.name==love){
			cout<<p->data.no<<" "<<p->data.name<<" "<<p->data.price<<endl;
		}
	
		p=p->next;
	}
	
}

int main(){
	LinkList L;
	InitList(L);
	CreateList(L);
	int num;
	cin>>num;
	string love[num];
	for(int j=0;j<num;j++)
		cin>>love[j]; 
	for(int i=0;i<num;i++){
		if(TraverseList(L,love[i])!=0){
			cout<<TraverseList(L,love[i])<<endl;
			PrintList(L,love[i]); 
		}
		else cout<<"Sorry,there is no your favourite!"<<endl;
			
	}
	
}

基于链式存储结构的图书信息表的最佳位置图书的查找

#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<iomanip>

typedef int status;

#define OK 1

using namespace std;

typedef struct{
	string no;
	string name;
	float price;
}Book;

typedef struct LNode{
	Book data;
	struct LNode* next;
}LNode,*LinkList;

void InitList(LinkList& L){
	L=new LNode;
	L->next=NULL;
}

int CreateList(LinkList& L){
	int n;
	cin>>n; //链表长度 
	string no,name;
	float price;
	LinkList r,p;
	r=L; //等于L比较好,如果等于L->next,之后会出现r=p->next的情况,这时候r的next就不太好了 
	int cnt=0;
	while(cnt<n){
		cin>>no>>name>>price;
		p=new LNode; //不要漏掉! 
		p->data.no=no;
		p->data.name=name;
		p->data.price=price;
		p->next=NULL;
		r->next=p;
		r=p;
		
		cnt++;
	}
	return n;
}

//返回最爱图书的数量 
int TraverseList(LinkList&L,string love){
	LinkList p=L->next;
	int cnt=0;
	while(p){
		if(p->data.name==love)
			cnt++; 
		p=p->next;
	}
	return cnt;
}

void PrintList(LinkList& L,int place,int n){
	if(place<1||place>=n)cout<<"Sorry,the book on the best position doesn't exist!"<<endl;
	else{
		LinkList p=L->next;
		int index=0;
		while(p){
			cout<<fixed<<setprecision(2);
			if(index==place-1){
				cout<<p->data.no<<" "<<p->data.name<<" "<<p->data.price<<endl;
				break;
			}
	
		p=p->next;
		index++;
		}
	}
	
	
}

int main(){
	LinkList L;
	InitList(L);
	int n=CreateList(L);
	int searchNum; //要查找的图书的数目
	cin>>searchNum;
	int place[searchNum];
	for(int i=0;i<searchNum;i++){
		cin>>place[i];
	} 
	for(int i=0;i<searchNum;i++){
		PrintList(L,place[i],n);
	}
	
}

接下来是入库出库(即插入删除)

#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<iomanip>

typedef int status;

#define OK 1

using namespace std;

typedef struct{
	string no;
	string name;
	float price;
}Book;

typedef struct LNode{
	Book data;
	struct LNode* next;
}LNode,*LinkList;     //这样typedef,可以在后期比较方便地创建指向链表结点的指针 

void InitList(LinkList& L){
	L=new LNode;
	L->next=NULL;
}

//创建链表(含头结点),顺便返回链表长度 
int CreateList(LinkList& L){
	int elemCnt;
	cin>>elemCnt;
	string no,name;
	float price;
	LinkList r=L;
	LinkList p;

	for(int i=0;i<elemCnt;i++){
		//后插法创建链表
		cin>>no>>name>>price;

		p=new LNode;
		p->data.no=no;
		p->data.name=name;
		p->data.price=price;
		p->next=NULL;
		
		r->next=p;
		r=p;
		 
	} 
	return elemCnt;
}

//插入链表
bool InsertList(LinkList& L,int n,int place,Book b){
	bool flag=true;
	if(place<1 || place>n){
		cout<<"Sorry,the position to be inserted is invalid!"; 
		flag=false;		
	}

	else{
		LinkList p=L; 
		int cnt=0;
		while(cnt<place-1 && p){
			p=p->next; //找到要插入位置的前一个
			cnt++;			
		}
		//已找到位置
		LinkList q=new LNode;
		q->data.no=b.no;
		q->data.name=b.name;
		q->data.price=b.price;
		q->next=NULL;
		
		q->next=p->next;
		p->next=q;
	 
	}
	return flag;
} 

void PrintList(LinkList& L){
	LinkList p=L->next;
	while(p){
		cout<<fixed<<setprecision(2);
		cout<<p->data.no<<" "<<p->data.name<<" "<<p->data.price<<endl;
		p=p->next;
	}
	
}

int main(){
	LinkList L;
	InitList(L);
	int n=CreateList(L);
	int place;
	cin>>place;
	Book b;
	cin>>b.no>>b.name>>b.price;
	if(InsertList(L,n,place,b))
		PrintList(L);
	return 0;
} 

知识点

当设计插入、删除这些操作时,因为要输出不合法的情况,所以可以为插入删除函数设置一个bool类型的返回值

下面是出库(搞清楚链表怎么插入怎么删除就行很简单)

#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<iomanip>

typedef int status;

#define OK 1

using namespace std;

typedef struct{
	string no;
	string name;
	float price;
}Book;

typedef struct LNode{
	Book data;
	struct LNode* next;
}LNode,*LinkList;     //这样typedef,可以在后期比较方便地创建指向链表结点的指针 

void InitList(LinkList& L){
	L=new LNode;
	L->next=NULL;
}

//创建链表(含头结点),顺便返回链表长度 
int CreateList(LinkList& L){
	int elemCnt;
	cin>>elemCnt;
	string no,name;
	float price;
	LinkList r=L;
	LinkList p;

	for(int i=0;i<elemCnt;i++){
		//后插法创建链表
		cin>>no>>name>>price;

		p=new LNode;
		p->data.no=no;
		p->data.name=name;
		p->data.price=price;
		p->next=NULL;
		
		r->next=p;
		r=p;
		 
	} 
	return elemCnt;
}

//删除链表
bool DeleteList(LinkList& L,int n,int place){
	bool flag=true;
	if(place<1 || place>n){
		cout<<"Sorry,the position to be deleted is invalid!"; 
		flag=false;		
	}

	else{
		LinkList p=L; 
		int cnt=0;
		while(cnt<place-1 && p){
			p=p->next; //找到要插入位置的前一个
			cnt++;			
		}
		//已找到位置
		
		LinkList tmp=p->next;
		p->next=tmp->next; 
		free(tmp);
	 
	}
	return flag;
} 

void PrintList(LinkList& L){
	LinkList p=L->next;
	while(p){
		cout<<fixed<<setprecision(2);
		cout<<p->data.no<<" "<<p->data.name<<" "<<p->data.price<<endl;
		p=p->next;
	}
	
}

int main(){
	LinkList L;
	InitList(L);
	int n=CreateList(L);
	int place;
	cin>>place;
	if(DeleteList(L,n,place))
		PrintList(L);
	return 0;
} 

图书去重

#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<iomanip>

typedef int status;

#define OK 1

using namespace std;

typedef struct{
	string no;
	string name;
	float price;
}Book;

typedef struct LNode{
	Book data;
	struct LNode* next;
}LNode,*LinkList;     //这样typedef,可以在后期比较方便地创建指向链表结点的指针 

void InitList(LinkList& L){
	L=new LNode;
	L->next=NULL;
}

//创建链表(含头结点),顺便返回链表长度 
int CreateList(LinkList& L){
	int elemCnt;
	cin>>elemCnt;
	
	int realCnt=elemCnt;
	
	string no,name;
	float price;
	LinkList r=L;
	LinkList p;
	LinkList tmp;

	for(int i=0;i<elemCnt;i++){
		//后插法创建链表
		cin>>no>>name>>price;
		tmp=L->next;
		bool ifInsert=true;
		while(tmp){
			if(tmp->data.no==no){
				cout<<"有重名"<<endl;
				realCnt--;
				ifInsert=false;
			}
			tmp=tmp->next;
		}
		if(ifInsert){
			p=new LNode;
			p->data.no=no;
			p->data.name=name;
			p->data.price=price;
			p->next=NULL;
		
			r->next=p;
			r=p;
			cout<<"成功插入"<<endl;
		}
		
		 
	} 
	return realCnt;
}



void PrintList(LinkList& L){
	LinkList p=L->next;
	while(p){
		cout<<fixed<<setprecision(2);
		cout<<p->data.no<<" "<<p->data.name<<" "<<p->data.price<<endl;
		p=p->next;
	}
	
}

int main(){
	LinkList L;
	InitList(L);
	cout<<CreateList(L)<<endl;
	PrintList(L);
	return 0;
} 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/444057.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

J8 - Inception v1算法

目录 理论知识Inception卷积计算 模型结构模型实现inception 结构GoogLeNet模型打印模型结构 模型效果总结与心得体会 理论知识 GoogLeNet首次出现就在2014年的ILSVRC比赛中获得冠军&#xff0c;最初的版本为InceptionV1。共有22层深&#xff0c;参数量5M。 可以达到同时期VGG…

【C++进阶】哈希的应用 --- 布隆过滤器

&#x1f466;个人主页&#xff1a;Weraphael ✍&#x1f3fb;作者简介&#xff1a;目前学习C和算法 ✈️专栏&#xff1a;C航路 &#x1f40b; 希望大家多多支持&#xff0c;咱一起进步&#xff01;&#x1f601; 如果文章对你有帮助的话 欢迎 评论&#x1f4ac; 点赞&#x1…

申请公众号上限是多少

一般可以申请多少个公众号&#xff1f;公众号申请限额在过去几年内的经历了很多变化。对公众号申请限额进行调整是出于多种原因&#xff0c;确保公众号内容的质量和合规性。企业公众号的申请数量从50个到5个最后到2个&#xff0c;对于新媒体公司来说&#xff0c;这导致做不了公…

七、软考-系统架构设计师笔记-数据库设计基础知识

1、数据库基础概念 数据库基本概念 数据(Data)数据库(Database)数据库管理系统(DBMS)数据库系统(DBS) 1.数据(Data) 是数据库中存储的基本对象&#xff0c;是描述事物的符号记录。 数据的种类&#xff1a; 文本、图形、图像、音频、视频等。 2.数据库(Database, DB) 数据库…

【Python+Selenium学习系列5】Selenium特殊元素定位之-鼠标悬停操作

前言 Selenium模拟用户在浏览器中的操作&#xff0c;比如点击按钮。在某些场景下&#xff0c;我们需要模拟鼠标悬停的操作&#xff0c;来触发一些隐藏的元素。本文将介绍Python Selenium实现鼠标悬停操作。 鼠标悬停&#xff0c;即当光标与其名称表示的元素重叠时触发的事件&…

菜鸟笔记-14Python绘图颜色使用

Python中绘图主要依赖于各种库&#xff0c;其中matplotlib是最常用且功能强大的一个。在matplotlib中&#xff0c;你可以使用各种颜色来表示不同的数据点、线条或填充区域。下面我将详细介绍如何在Python中使用matplotlib来设置绘图颜色&#xff0c;并给出具体的例子。 14.1颜…

HTML5:七天学会基础动画网页10

继续介绍3D转换: 3D转换:rotate3d 方法与说明 rrotateX(angle)otate3d(x,y,z,angle[角度]) 3D转换&#xff0c;正常取值0/1&#xff0c;0代表当前轴线不进行旋转&#xff0c;1反之&#xff0c;例:rotate3d(1,1,1,30deg)&#xff0c;代表三个轴线都要旋转30度 rotate3d(0…

.text .data .bss .stack 和 heap

.text .data .bss .stack 和 heap 1.1 代码->可执行文件1.2 ELF可执行文件的结构1.3 内存区域1.4 各段在内存中的位置 1.1 代码->可执行文件 一个程序从代码到可执行文件的过程&#xff0c;包括 预处理、编译、汇编&#xff0c;链接。可执行文件有多重类型&#xff0c;有…

深入解读可视化运维的内容、领域、价值和系统搭建

大家好&#xff0c;我是贝格前端工场&#xff0c;接触过很多可视化运维项目&#xff0c;包括IT、电力、物流、生产制造等&#xff0c;本文系统总结一下可视化运维相关知识&#xff0c;老规矩别忘了关注转发&#xff0c;有事请私信。 一、可视化运维定义 可视化运维是指通过可视…

寻找完全平方数——浮点数陷阱

【题目描述】 输出所有形如aabb的4位完全平方数&#xff08;即前两位数字相等&#xff0c;后两位数字也相等&#xff09;。 【解析】 一、问题分析 从问题出发&#xff0c;题目要求输出的是满足一定条件的数。数在计算机中是要占存储空间的&#xff0c;要在计算机中表示一个…

linux 查看打开使用了哪些端口

你可以使用 netstat 命令来查看Linux系统中正在使用的端口。例如&#xff0c;要查看所有正在使用的TCP和UDP端口&#xff0c;你可以运行&#xff1a; sudo netstat -tulpn如果你只想查看所有正在使用的TCP端口&#xff0c;你可以运行&#xff1a; sudo netstat -tpln 如果你只…

滴滴一面:Keepalived+Nginx高可用,如何实现IP跳跃?(1)

尼恩说在前面 HashMap的工作原理是目前java面试问的较为常见的问题之一&#xff0c;在40岁老架构师 尼恩的读者交流群(50)中&#xff0c;最近有小伙伴拿到了一线互联网企业如得物、阿里、滴滴、极兔、有赞、shein 希音、百度、网易的面试资格&#xff0c;遇到很多很重要的面试…

蓝桥杯-List集合

目录 List集合实例化 List集合实例化步骤 常用方法 ArrayList方法 1&#xff1a;add(Object element) 2&#xff1a;size() 3&#xff1a;get(int index) 4&#xff1a;isEmpty() 5:contains(Object o) 6&#xff1a;remove(int index) 总结ArrayList list集合的特点…

Elasticsearch从入门到精通-03基本语法学习

Elasticsearch从入门到精通-03基本语法学习 &#x1f44f;作者简介&#xff1a;大家好&#xff0c;我是程序员行走的鱼 &#x1f4d6; 本篇主要介绍和大家一块学习一下ES基本语法,主要包括索引管理、文档管理、映射管理等内容 1.1 了解Restful ES对数据进行增、删、改、查是以…

多线程-线程池原子性并发工具类

1.线程池 1.线程状态 虚拟机中线程的六种状态 新建状态&#xff08;NEW&#xff09; --创建线程 就绪状态&#xff08;RUNNABLE&#xff09; --start方法 阻塞状态&#xff08;BLOCKED&#xff09; --无法获得锁对象 等待状态&#xff08;WAITING&#xff09; …

MySQL学习Day28——锁

一、概述: 锁是计算机协调多个进程或线程并发访问某一资源的机制。在程序开发中会存在多线程同步的问题&#xff0c;当多个线程并发访问某个数据的时候&#xff0c;尤其是针对一些敏感的数据(比如订单、金额等)需要保证这个数据在任何时刻最多只有一个线程在访问&#xff0c;保…

蓝桥杯简单题,公司名称

题目链接&#xff08;需要登录&#xff09; #include <iostream> #include <cstring> #include <algorithm> using namespace std; bool lanqiao(string str,int len){ sort(str.begin(),str.end());//对str按照ascii排序if(str.find("Laainoq")s…

HTML静态网页成品作业(HTML+CSS)——安徽宣笔设计制作(5个页面)

&#x1f389;不定期分享源码&#xff0c;关注不丢失哦 文章目录 一、作品介绍二、作品演示三、代码目录四、网站代码HTML部分代码 五、源码获取 一、作品介绍 &#x1f3f7;️本套采用HTMLCSS&#xff0c;未使用Javacsript代码&#xff0c;共有6个页面。 &#x1f3f7;️想要…

Linux系统——web服务拓展练习

目录 一、实验环境搭建 1. Centos 7-5——Client 2. Centos 7-1——网关服务器 3. Centos 7-2——Web1 4. Centos 7-3——Web2 5. Centos 7-4——Nginx 二、在Nginx服务器上搭建LNMP服务&#xff0c;并且能够对外提供Discuz论坛服务&#xff1b;在Web1、Web2服务器上搭建…

springboot255基于spring boot的疫情信息管理系统

疫情信息管理系统的设计与实现 摘要 近年来&#xff0c;信息化管理行业的不断兴起&#xff0c;使得人们的日常生活越来越离不开计算机和互联网技术。首先&#xff0c;根据收集到的用户需求分析&#xff0c;对设计系统有一个初步的认识与了解&#xff0c;确定疫情信息管理系统…
最新文章