当前位置: 首页 > news >正文

[STL]list使用介绍

[STL]list使用

注:本文测试环境是visual studio2019。

文章目录

  • [STL]list使用
    • 1. list介绍
    • 2. 构造函数
    • 3. 迭代器相关函数
      • begin函数和end函数
      • rbegin函数和rend函数
    • 4. 容量相关函数
      • empty函数
      • size函数
    • 5. 数据修改函数
      • push_back函数和pop_back函数
      • push_front函数和pop_front函数
      • insert函数和erase函数
      • swap函数
      • resize函数
      • clear函数
    • 6. 数据操作函数
      • sort函数
      • reverse函数
      • merge函数
      • unique函数
      • remove函数
      • splice函数

1. list介绍

  1. list是可以在常量时间内在任意位置进行插入和删除的序列式容器,并且该容器可以前后双向迭代。
  2. list的底层是双向链表结构,双向链表中每个元素存储在互不相关的独立节点中,在节点中通过指针指向其前一个元素和后一个元素。
  3. list与forward_list非常相似:最主要的不同在于forward_list是单链表,只能朝前迭代,已让其更简单高效。
  4. 与其他的序列式容器相比(array,vector,deque),list通常在任意位置进行插入、移除元素的执行效率更好。
  5. 与其他序列式容器相比,list和forward_list最大的缺陷是不支持任意位置的随机访问,比如:要访问list 的第6个元素,必须从已知的位置(比如头部或者尾部)迭代到该位置。

2. 构造函数

image-20230618212401437

(1)构造函数

默认构造函数。

list<int> l; //创建一个空list

(2)构造函数

创建一个有n个结点,结点数据为val的list。

list<int> l(10, 66); 

(3)构造函数

使用迭代器构造列表。

vector<int> v(10, 6);
list<int> l(v.begin(), v.end()); //创建一个存储int类型的链表,使用v初始化数据

(4)构造函数

拷贝构造函数

list<int> l1(10,6);
list<int> l2(l1); //使用l2拷贝构造l1

3. 迭代器相关函数

begin函数和end函数

begin函数:

返回指向list第一个结点的正向迭代器。

end函数:

返回指向list结尾的正向迭代器。

#include <iostream>
#include <list>
#include <vector>
using namespace std;
int main()
{vector<int> v;v.push_back(1); //在list中尾插数据1v.push_back(2); //在list中尾插数据2v.push_back(3);	//在list中尾插数据3v.push_back(4);	//在list中尾插数据4list<int> l(v.begin(), v.end());list<int>::iterator it = l.begin();while (it != l.end()){cout << *it << " ";it++;}cout << endl; //输出为 1 2 3 4return 0;
}

rbegin函数和rend函数

rbegin函数:

返回指向list最后一个含有数据的结点的反向迭代器。

rend函数:

指向list反向结尾的反向迭代器。

#include <iostream>
#include <list>
#include <vector>
using namespace std;
int main()
{vector<int> v;v.push_back(1); //在list中尾插数据1v.push_back(2); //在list中尾插数据2v.push_back(3);	//在list中尾插数据3v.push_back(4);	//在list中尾插数据4list<int> l(v.begin(), v.end());list<int>::reverse_iterator it = l.rbegin();while (it != l.rend()){cout << *it << " ";it++;}cout << endl; //输出为 4 3 2 1return 0;
}

4. 容量相关函数

empty函数

判断list是否为空.

#include <iostream>
#include <list>
#include <vector>
using namespace std;
int main()
{list<int> l1;list<int> l2(5, 6);cout << l1.empty() << endl;//输出为1cout << l2.empty() << endl;//输出为0return 0;
}

size函数

获取list存储的结点个数。

#include <iostream>
#include <list>
#include <vector>
using namespace std;
int main()
{vector<int> v;v.push_back(1); //在list中尾插数据1v.push_back(2); //在list中尾插数据2v.push_back(3);	//在list中尾插数据3v.push_back(4);	//在list中尾插数据4list<int> l(v.begin(), v.end());cout << l.size() << endl;  //输出为4return 0;
}

5. 数据修改函数

push_back函数和pop_back函数

push_back函数:

在list结尾插入结点。

#include <iostream>
#include <list>
using namespace std;
int main()
{list<int> l;l.push_back(1);l.push_back(2);l.push_back(3);cout << l.size() << endl; //输出为3return 0;
}

pop_back函数:

在list结尾删除结点。

#include <iostream>
#include <list>
using namespace std;
int main()
{list<int> l;l.push_back(1);l.push_back(2);l.push_back(3);cout << l.size() << endl; //输出为3l.pop_back();l.pop_back();cout << l.size() << endl; //输出为1l.pop_back();//l.pop_back(); -- 报错 -- 没有结点可删return 0;
}

push_front函数和pop_front函数

push_front函数:

在list中头插结点。

#include <iostream>
#include <list>
using namespace std;
int main()
{list<int> l;l.push_front(1);l.push_front(2);l.push_front(3);l.push_front(4);list<int>::iterator it = l.begin();while (it != l.end()){cout << *it << " ";++it;}cout << endl; // 输出为 4 3 2 1return 0;
}

pop_front函数:

在list中头删结点。

#include <iostream>
#include <list>
using namespace std;
int main()
{list<int> l;l.push_front(1);l.push_front(2);l.push_front(3);l.push_front(4);list<int>::iterator it = l.begin();while (it != l.end()){cout << *it << " ";++it;}cout << endl;l.pop_front();l.pop_front();it = l.begin();while (it != l.end()){cout << *it << " ";++it;}cout << endl; // 输出为 2 1return 0;
}

insert函数和erase函数

和vector容器类似,list容器也没有提供find函数,而insert函数和erase函数是需要配合迭代器使用的,因此需要使用算法库的find函数。

image-20230619211015257

find函数查找成功会返回指向数据的迭代器,失败会返回传入的last迭代器,注意find函数的查找范围是从first迭代器至last迭代器前,不包括last迭代器。

insert函数

功能1: 在某一位置插入结点。

#include <iostream>
#include <list>
#include <algorithm>
using namespace std;
int main()
{list<int> l;l.push_back(1);l.push_back(2);l.push_back(3);l.push_back(4);list<int>::iterator pos = find(l.begin(), l.end(), 2);l.insert(pos, 66);list<int>::iterator it = l.begin();while (it != l.end()){cout << *it << " ";++it;}cout << endl; //输出为1 66 2 3 4return 0;
}

功能2: 在某一位置插入n个存储相同数据的结点。

#include <iostream>
#include <list>
#include <algorithm>
using namespace std;
int main()
{list<int> l;l.push_back(1);l.push_back(2);l.push_back(3);l.push_back(4);list<int>::iterator pos = find(l.begin(), l.end(), 2);l.insert(pos, 3, 66);list<int>::iterator it = l.begin();while (it != l.end()){cout << *it << " ";++it;}cout << endl; //输出为1 66 66 66 2 3 4return 0;
}

功能3: 传入其他list容器或者其他类型容器的迭代器,将传入的迭代器区间内的数据插入。

#include <iostream>
#include <list>
#include <algorithm>
using namespace std;
int main()
{list<int> l1(3, 66);list<int> l2;l2.push_back(1);l2.push_back(2);l2.push_back(3);list<int>::iterator pos = find(l2.begin(), l2.end(), 2);l2.insert(pos, l1.begin(), l1.end());list<int>::iterator it = l2.begin();while (it != l2.end()){cout << *it << " ";++it;}cout << endl;  //输出为1 66 66 66 2 3return 0;
}

erase函数

功能1: 删除迭代器指向的结点。

#include <iostream>
#include <list>
#include <algorithm>
using namespace std;
int main()
{list<int> l;l.push_back(1);l.push_back(2);l.push_back(3);list<int>::iterator pos = find(l.begin(), l.end(), 2);l.erase(pos);list<int>::iterator it = l.begin();while (it != l.end()){cout << *it << " ";++it;}cout << endl; // 输出为 1 3return 0;
}

功能2: 将迭代器范围的结点都删除。

#include <iostream>
#include <list>
#include <algorithm>
using namespace std;
int main()
{list<int> l;l.push_back(1);l.push_back(2);l.push_back(3);l.push_back(4);l.push_back(5);list<int>::iterator start = find(l.begin(), l.end(), 2);list<int>::iterator finish = find(l.begin(), l.end(), 5);l.erase(start, finish);list<int>::iterator it = l.begin();while (it != l.end()){cout << *it << " ";++it;}cout << endl; // 输出为 1 5return 0;
}

swap函数

将两个list数据交换,通过交换list指向的头结点实现。

#include <iostream>
#include <list>
using namespace std;
int main()
{list<int> l1(3, 66);list<int> l2;l2.push_back(1);l2.push_back(2);l2.push_back(3);l1.swap(l2);list<int>::iterator it1 = l1.begin();while (it1 != l1.end()){cout << *it1 << " ";  //输出为 1 2 3++it1;}cout << endl;list<int>::iterator it2 = l2.begin();while (it2 != l2.end()){cout << *it2 << " "; //输出为 66 66 66++it2;}cout << endl;return 0;
}

resize函数

image-20230619215305106

  1. 如果n < size, 会将结点删除至list只有n个结点,由于list结点的释放成本是不高的,因此不同于vector只是将末尾指向修改,list会实际上的在调用resize函数时的删除结点。
  2. 如果n > size,就将插入结点使得list有n个结点
#include <iostream>
#include <list>
using namespace std;
int main()
{list<int> l;l.push_back(1);l.push_back(2);l.push_back(3);l.push_back(4);l.push_back(5);cout << l.size() << endl; //输出为5l.resize(3); // n < sizecout << l.size() << endl; //输出为3l.resize(6); // n > sizecout << l.size() << endl; //输出为6return 0;
}

clear函数

释放所有结点,使得list为空链表。

#include <iostream>
#include <list>
using namespace std;
int main()
{list<int> l(66, 6);cout << l.size() << endl; // 输出为66l.clear();cout << l.size() << endl; // 输出为0return 0;
}

6. 数据操作函数

sort函数

对list中的数据进行排序。

#include <iostream>
#include <list>
using namespace std;int main()
{list<int> l1;l1.push_back(2);l1.push_back(1);l1.push_back(4);l1.push_back(7);l1.push_back(5);l1.push_back(9);l1.push_back(8);l1.sort();list<int>::iterator it = l1.begin();it = l1.begin();while (it != l1.end()){cout << *it << ' ';  //输出为: 1 2 4 5 7 8 9it++;}return 0;
}

注: 由于list是链表实现的,迭代器是双向迭代器,因此不能调用algorithm库内的sort函数,因此需要单独设计sort函数,但是list的sort函数由于结构原因导致性能不高。

reverse函数

将list内的结点逆置。

#include <iostream>
#include <list>
using namespace std;
int main()
{list<int> l;l.push_back(1);l.push_back(2);l.push_back(3);l.push_back(4);list<int>::iterator it = l.begin();while (it != l.end()){cout << *it << ' ';  //输出为: 1 2 3 4it++;}l.reverse(); //将list逆置it = l.begin();while (it != l.end()){cout << *it << ' '; //输出为: 4 3 2 1it++;}cout << endl;return 0;
}

merge函数

如果两个list有序并且排序方式相同,可以将一个list的结点连接到另一个list上并保持有序,排序方式和连接前相同。

#include <iostream>
#include <list>
using namespace std;
int main()
{list<int> l1;l1.push_back(1);l1.push_back(2);l1.push_back(3);l1.push_back(4);list<int> l2;l2.push_back(6);l2.push_back(7);l2.push_back(8);l2.push_back(9);l2.merge(l1); //将l1的结点连接到l2,连接后l1为空list<int>::iterator it = l2.begin();while (it != l2.end()){cout << *it << ' ';it++;}cout << endl;return 0;
}

unique函数

只能给数据有序的list进行数据去重操作,如果数据无序去重操作会出现问题。

#include <iostream>
#include <list>
using namespace std;
int main()
{list<int> l;l.push_back(1);l.push_back(2);l.push_back(2);l.push_back(2);l.push_back(3);l.push_back(3);l.push_back(3);l.push_back(4);l.unique();	//对list内的数据去重list<int>::iterator it = l.begin();while (it != l.end()){cout << *it << ' ';	// 输出为: 1 2 3 4it++;}cout << endl;return 0;
}

remove函数

查找对应的数据并进行删除操作,数据存在就删除,不存在不会进行任何操作。

#include <iostream>
#include <list>
using namespace std;
int main()
{list<int> l;l.push_back(1);l.push_back(2);l.push_back(3);l.push_back(4);l.remove(3); //删除数据为3的结点list<int>::iterator it = l.begin();while (it != l.end()){cout << *it << ' '; //输出为: 1 2 4it++;}cout << endl;return 0;
}

splice函数

将以一个list的指定部分的结点转移给其他list。

#include <iostream>
#include <list>
using namespace std;int main()
{list<int> l1;l1.push_back(1);l1.push_back(2);l1.push_back(3);l1.push_back(4);list<int> l2;l2.push_back(5);l2.push_back(6);l2.push_back(9);l2.push_back(8);list<int>::iterator it = l1.begin();l1.splice(it, l2); //将l2的所有结点转移到l1的begin位置it = l1.begin();while (it != l1.end()){cout << *it << ' '; //输出为:5 6 9 8 1 2 3 4it++;}return 0;
}

相关文章:

[STL]list使用介绍

[STL]list使用 注&#xff1a;本文测试环境是visual studio2019。 文章目录 [STL]list使用1. list介绍2. 构造函数3. 迭代器相关函数begin函数和end函数rbegin函数和rend函数 4. 容量相关函数empty函数size函数 5. 数据修改函数push_back函数和pop_back函数push_front函数和pop…...

k8s服务发现之第五弹--使用 Service 连接到应用

Kubernetes 的网络模型 通过前面教程的学习&#xff0c;我们已经可以将容器化的应用程序在 Kubernetes 中运行起来&#xff0c;并且发布到 Kubernetes 内/外的网络上。 通常&#xff0c;Docker 使用一种 host-private 的联网方式&#xff0c;在此情况下&#xff0c;只有两个容…...

SAP ABAP 自定义表数据导入

一:效果展示&#xff1a; 读取 Excel 数据到 SAP 数据库表。 二&#xff1a;源码&#xff1a; *&---------------------------------------------------------------------* *& Report ZTEST_DRW02 *&----------------------------------------------------------…...

目标检测识别——大恒(DaHeng)相机操作与控制编程

文章目录 引言正文相关开发库的介绍编程准备配置引用头文件GalaxyIncludes.h配置lib文件 具体编程过程初始化和反初始化枚举设备开关设备 属性控制属性控制器种类 图像采集控制和图像处理采单帧回调采集 总结 引言 在做老师的横向项目时&#xff0c;需要用大恒相机&#xff0c…...

国标GB28181视频监控平台EasyGBS视频无法播放,抓包返回ICMP是什么原因?

国标GB28181视频平台EasyGBS是基于国标GB/T28181协议的行业内安防视频流媒体能力平台&#xff0c;可实现的视频功能包括&#xff1a;实时监控直播、录像、检索与回看、语音对讲、云存储、告警、平台级联等功能。国标GB28181视频监控平台部署简单、可拓展性强&#xff0c;支持将…...

如何正确使用npm常用命令

npm常用命令&#xff1a; 官方文档&#xff1a;CLI Commands | npm Docs 1. npm -v&#xff1a;查看 npm 版本 2. npm init&#xff1a;初始化后会出现一个 Package.json 配置文件&#xff0c;可以在后面加上 -y&#xff0c;快速跳到问答界面 3. npm install&#xff1a;会…...

无人机影像配准并发布(共线方程)

无人机影像 DEM 计算四个角点坐标&#xff08;刚性变换&#xff09; 像空间坐标&#xff08;x,y,-f&#xff09; 像空间坐标畸变纠正 deltax,deltay 已知(x,y)&#xff0c;求解(X,Y, Z)或者(Lat,Lon) 这里的Z是DEM上获取的坐标和Zs为相机坐标的高程&#xff0c;如果均为已…...

openGauss学习笔记-23 openGauss 简单数据管理-时间/日期函数和操作符

文章目录 openGauss学习笔记-23 openGauss 简单数据管理-时间/日期函数和操作符23.1 时间日期操作符23.2 时间/日期函数23.3 TIMESTAMPDIFF23.4 EXTRACT23.5 date_part openGauss学习笔记-23 openGauss 简单数据管理-时间/日期函数和操作符 23.1 时间日期操作符 用户在使用时…...

C++OpenCV(7):图像形态学基础操作

&#x1f506; 文章首发于我的个人博客&#xff1a;欢迎大佬们来逛逛 &#x1f506; OpenCV项目地址及源代码&#xff1a;点击这里 文章目录 膨胀与腐蚀形态学基础 膨胀与腐蚀 膨胀与腐蚀是数学形态学在图像处理中最基础的操作。 膨胀操作是取每个位置领域内最大值&#xff0…...

Appium+python自动化(二十二)- 控件坐标获取(超详解)

简介 有些小伙伴或者是童鞋可能会好奇会问上一篇中的那个monkey脚本里的坐标点是如何获取的&#xff0c;不是自己随便蒙的猜的&#xff0c;或者是自己用目光或者是尺子量出来的吧&#xff0c;答案当然是&#xff1a;NO。获取控件坐标点的方式这里宏哥给小伙伴们分享和讲解三种方…...

Tensorflow benchmark 实操指南

环境搭建篇见环境搭建-CentOS7下Nvidia Docker容器基于TensorFlow1.15测试GPU_东方狱兔的博客-CSDN博客 1. 下载Benchmarks源码 从 TensorFlow 的 Github 仓库上下载 TensorFlow Benchmarks&#xff0c;可以通过以下命令来下载 https://github.com/tensorflow/benchmarks 我…...

【linux】调试工具介绍

文章目录 前言一、kdb二、ftrace三、gdb 前言 在Linux内核调试过程中&#xff0c;可以使用各种工具和技术来诊断和解决问题。以下是一些常用的Linux内核调试方法&#xff1a; printk&#xff1a;printk是Linux内核中的打印函数&#xff0c;可以在代码中插入打印语句来输出调试…...

2.获取DOM元素

获取DOM元素就是利用JS选择页面中的标签元素 2.1 根据CSS选择器来获取DOM元素(重点) 2.1.1选择匹配的第一个元素 语法: document.querySelector( css选择器 )参数: 包含一个或多个有效的CSS选择器 字符串 返回值: CSS选择器匹配的第一个元素&#xff0c;一个HTMLElement对象…...

flask中redirect、url_for、endpoint介绍

flask中redirect、url_for、endpoint介绍 redirect 在 Flask 中&#xff0c;redirect() 是一个非常有用的函数&#xff0c;可以使服务器发送一个HTTP响应&#xff0c;指示客户端&#xff08;通常是浏览器&#xff09;自动导航到新的 URL。基本上&#xff0c;它是用来重定向用…...

《MySQL》第十二篇 数据类型

目录 一. 整数类型二. 浮点类型三. 日期和时间类型四. 字符串类型五. 枚举值类型六. 二进制类型七. 小结 MySQL 支持多种数据类型&#xff0c;学习好数据类型&#xff0c;才能更好的学习 MySQL 表的设计&#xff0c;让表的设计更加合理。 一. 整数类型 类型大小SIGNED(有符号)…...

Python与OpenCV环境中,借助SIFT、单应性、KNN以及Ransac技术进行实现的图像拼接算法详细解析及应用

一、引言 在当今数字化时代,图像处理技术的重要性不言而喻。它在无人驾驶、计算机视觉、人脸识别等领域发挥着关键作用。作为图像处理的一个重要部分,图像拼接算法是实现广阔视野图像的重要手段。今天我们将会讲解在Python和OpenCV环境下,如何使用SIFT、单应性、KNN以及Ran…...

苍穹外卖Day01项目日志

1.软件开发流程和人员分工是怎样的&#xff1f; 软件开发流程 一个软件是怎么被开发出来的&#xff1f; 需求分析 先得知道软件定位人群、用户群体、有什么功能、要实现什么效果等。 需要得到需求规格说明书、产品原型。 需求规格说明书 其中前后端工程师要关注的就是产品原…...

Netty学习(二)

文章目录 二. Netty 入门1. 概述1.1 Netty 是什么&#xff1f;1.2 Netty 的作者1.3 Netty 的地位1.4 Netty 的优势 2. Hello World2.1 目标加入依赖 2.2 服务器端2.3 客户端2.4 流程梳理课堂示例服务端客户端 分析提示&#xff08;重要&#xff09; 3. 组件3.1 EventLoop事件循…...

ReactRouterv5在BrowserRouter和HashRouter模式下对location.state的支持

结论&#xff1a;HashRouter不支持location.state 文档&#xff1a;ReactRouter v5 从文档可看到history.push()方法支持2个参数&#xff1a;path, [state] state即是location.state&#xff0c;常用于隐式地传递状态参数 但文档未提的是&#xff0c;仅适用于BrowserRouter&am…...

Aerotech系列文章(3)运动设置命令Motion Setup Commands

1.运动设置命令Motion Setup Commands 斜坡类型&#xff1a; 直线&#xff0c;S曲线&#xff0c;与正弦曲线 Enumerator: RAMPTYPE_Linear Linear-based ramp type. RAMPTYPE_Scurve S-curve-based ramp type. RAMPTYPE_Sine Sine-based ramp type. 函数原型&a…...

[特殊字符] 智能合约中的数据是如何在区块链中保持一致的?

&#x1f9e0; 智能合约中的数据是如何在区块链中保持一致的&#xff1f; 为什么所有区块链节点都能得出相同结果&#xff1f;合约调用这么复杂&#xff0c;状态真能保持一致吗&#xff1f;本篇带你从底层视角理解“状态一致性”的真相。 一、智能合约的数据存储在哪里&#xf…...

C++_核心编程_多态案例二-制作饮品

#include <iostream> #include <string> using namespace std;/*制作饮品的大致流程为&#xff1a;煮水 - 冲泡 - 倒入杯中 - 加入辅料 利用多态技术实现本案例&#xff0c;提供抽象制作饮品基类&#xff0c;提供子类制作咖啡和茶叶*//*基类*/ class AbstractDr…...

TDengine 快速体验(Docker 镜像方式)

简介 TDengine 可以通过安装包、Docker 镜像 及云服务快速体验 TDengine 的功能&#xff0c;本节首先介绍如何通过 Docker 快速体验 TDengine&#xff0c;然后介绍如何在 Docker 环境下体验 TDengine 的写入和查询功能。如果你不熟悉 Docker&#xff0c;请使用 安装包的方式快…...

Java - Mysql数据类型对应

Mysql数据类型java数据类型备注整型INT/INTEGERint / java.lang.Integer–BIGINTlong/java.lang.Long–––浮点型FLOATfloat/java.lang.FloatDOUBLEdouble/java.lang.Double–DECIMAL/NUMERICjava.math.BigDecimal字符串型CHARjava.lang.String固定长度字符串VARCHARjava.lang…...

Keil 中设置 STM32 Flash 和 RAM 地址详解

文章目录 Keil 中设置 STM32 Flash 和 RAM 地址详解一、Flash 和 RAM 配置界面(Target 选项卡)1. IROM1(用于配置 Flash)2. IRAM1(用于配置 RAM)二、链接器设置界面(Linker 选项卡)1. 勾选“Use Memory Layout from Target Dialog”2. 查看链接器参数(如果没有勾选上面…...

学习STC51单片机31(芯片为STC89C52RCRC)OLED显示屏1

每日一言 生活的美好&#xff0c;总是藏在那些你咬牙坚持的日子里。 硬件&#xff1a;OLED 以后要用到OLED的时候找到这个文件 OLED的设备地址 SSD1306"SSD" 是品牌缩写&#xff0c;"1306" 是产品编号。 驱动 OLED 屏幕的 IIC 总线数据传输格式 示意图 …...

精益数据分析(97/126):邮件营销与用户参与度的关键指标优化指南

精益数据分析&#xff08;97/126&#xff09;&#xff1a;邮件营销与用户参与度的关键指标优化指南 在数字化营销时代&#xff0c;邮件列表效度、用户参与度和网站性能等指标往往决定着创业公司的增长成败。今天&#xff0c;我们将深入解析邮件打开率、网站可用性、页面参与时…...

Linux C语言网络编程详细入门教程:如何一步步实现TCP服务端与客户端通信

文章目录 Linux C语言网络编程详细入门教程&#xff1a;如何一步步实现TCP服务端与客户端通信前言一、网络通信基础概念二、服务端与客户端的完整流程图解三、每一步的详细讲解和代码示例1. 创建Socket&#xff08;服务端和客户端都要&#xff09;2. 绑定本地地址和端口&#x…...

搭建DNS域名解析服务器(正向解析资源文件)

正向解析资源文件 1&#xff09;准备工作 服务端及客户端都关闭安全软件 [rootlocalhost ~]# systemctl stop firewalld [rootlocalhost ~]# setenforce 0 2&#xff09;服务端安装软件&#xff1a;bind 1.配置yum源 [rootlocalhost ~]# cat /etc/yum.repos.d/base.repo [Base…...

深度剖析 DeepSeek 开源模型部署与应用:策略、权衡与未来走向

在人工智能技术呈指数级发展的当下&#xff0c;大模型已然成为推动各行业变革的核心驱动力。DeepSeek 开源模型以其卓越的性能和灵活的开源特性&#xff0c;吸引了众多企业与开发者的目光。如何高效且合理地部署与运用 DeepSeek 模型&#xff0c;成为释放其巨大潜力的关键所在&…...