STL - 常用算法

news2024/9/24 1:14:14

常用遍历算法

 

for_each

 

#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

//常用遍历算法 - for_each

//普通函数
void print01(int val)
{
    cout << val << " ";
}
//仿函数
class print02 {
public:
    void operator()(int v)
    {
        cout << v << " ";
    }
};

void test01()
{
    vector<int> v;
    for (int i = 0; i < 10; i++) {
        v.push_back(i);
    }
    //    for_each(v.begin(), v.end(), print01);
    for_each(v.begin(), v.end(), print02());
    cout<<endl;
}
int main()
{

    test01();
}

 总结:for_each在实际开发中是最常用的遍历算法,需要熟练掌握。

transform

#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

//常用算法 - transform

//仿函数
class Transform {
public:
    int operator()(int v)
    {
        return v + 10;
    }
};

class MyPrint {
public:
    void operator()(int val)
    {
        cout << val << " ";
    }
};
void test01()
{
    vector<int> v;
    for (int i = 0; i < 10; i++) {
        v.push_back(i);
    }
    vector<int> v1;
    v1.resize(v.size()); // resize指定大小,不是reverse颠倒
    transform(v.begin(), v.end(), v1.begin(), Transform()); //第四个函数是仿函数
    for_each(v1.begin(), v1.end(), MyPrint());
    cout << endl;
}
int main()
{

    test01();
}

 常用查找算法

find算法

功能描述:
        查找指定元素,找到返回指定元素的迭代器,找不到返回结束迭代器end()

 

#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

//常用查找算法 - find
//查找内置数据类型
void test01()
{
    vector<int> v;
    v.push_back(1);
    v.push_back(2);
    v.push_back(3);
    v.push_back(4);
    v.push_back(5);
    vector<int>::iterator pos = find(v.begin(), v.end(), 21);
    if (pos == v.end()) {
        cout << "没有找到" << endl;
    } else {
        cout << "找到了" << *pos << endl;
    }
}
class Person {
public:
    string m_Name;
    int m_Age;
    Person(string name, int age)
    {
        this->m_Name = name;
        this->m_Age = age;
    }
    //重载==
    bool operator==(const Person& p)
    {
        if (this->m_Name == p.m_Name && this->m_Age == p.m_Age) {
            return true;
        } else {
            return false;
        }
    }
};
//查找自定义数据类型

void test02()
{
    vector<Person> v;
    Person p1("aa", 10);
    Person p2("bb", 20);
    Person p3("cc", 30);
    Person p4("dd", 40);
    v.push_back(p1);
    v.push_back(p2);
    v.push_back(p3);
    v.push_back(p4);
    Person pp("ces", 12);
    //自定义的数据类型需要重载==号
    vector<Person>::iterator pos = find(v.begin(), v.end(), p1);
    if (pos == v.end()) {
        cout << "没找到" << endl;
    } else {
        cout << "找到了" << pos->m_Name << " " << pos->m_Age << endl;
    }
}
int main()
{

    test02();
}

总结:利用find可以在容器中找指定的元素,返回值是迭代器

find_if

   

#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

//常用查找算法 - find_if
//查找内置数据类型
class GreaterFive {
public:
    bool operator()(int v)
    {
        return v > 3;
    }
};
void test01()
{
    vector<int> v;
    v.push_back(1);
    v.push_back(2);
    v.push_back(3);
    v.push_back(4);
    v.push_back(5);

    vector<int>::iterator pos = find_if(v.begin(), v.end(), GreaterFive());
    if (pos == v.end()) {
        cout << "没找到" << endl;
    } else {
        cout << "找到了 :" << *pos << endl;
    }
}

//查找自定义数据类型

class Person {
public:
    string m_Name;
    int m_Age;
    Person(string name, int age)
    {
        this->m_Name = name;
        this->m_Age = age;
    }
};
class Greater20 {
public:
    bool operator()(Person& p)
    {
        if (p.m_Age > 20) {
            return true;
        } else {
            return false;
        }
    }
};
void test02()
{
    vector<Person> v;
    Person p1("aa", 10);
    Person p2("bb", 20);
    Person p3("cc", 30);
    Person p4("dd", 40);
    v.push_back(p1);
    v.push_back(p2);
    v.push_back(p3);
    v.push_back(p4);
    Person pp("ces", 12);
    vector<Person>::iterator pos = find_if(v.begin(), v.end(), Greater20());
    while (true) {
        if (pos == v.end()) {
            cout << "没找到" << endl;
            break;
        } else {
            cout << "找到了" << pos->m_Name << " " << pos->m_Age << endl;
            pos++;
        }
    }
}
int main()
{

    test02();
}

 adjacent_find

 

#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

//常用查找算法 - adjacent_find

void test01()
{
    vector<int> v;
    v.push_back(1);
    v.push_back(3); //返回这里的位置
    v.push_back(3);
    v.push_back(4);
    v.push_back(2);
    v.push_back(3);

    vector<int>::iterator pos = adjacent_find(v.begin(), v.end());
    if (pos == v.end()) {
        cout << "没找到" << endl;
    } else {
        cout << "找到了 :" << *pos << endl;
    }
}

int main()
{

    test01();
}

 binary_search

功能描述:
        查找指定元素是否存在

 

#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

//常用查找算法 - binary_search  二分查找

void test01()
{
    vector<int> v;
    for (int i = 0; i < 10; i++) {
        v.push_back(i);
    }
    //    v.push_back(2);
    //查找容器中是否有元素9
    // 二分查找必须是排序好的序列,无序序列不可用
    bool exists = binary_search(v.begin(), v.end(), 9);
    if (exists) {
        cout << "存在" << endl;
    } else {
        cout << "不存在" << endl;
    }
}

int main()
{

    test01();
}

总结:二分查找法查找的效率很高,值得注意的是查找的容器中元素必须有序序列

count

功能描述:
        统计元素个数

#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

//常用查找算法 - count

// 1. 统计内置数据类型

void test01()
{
    vector<int> v;
    v.push_back(10);
    v.push_back(20);
    v.push_back(10);
    v.push_back(30);
    v.push_back(30);
    v.push_back(40);
    int number = count(v.begin(), v.end(), 40);
    cout << "40的元素个数:" << number << endl;
}
// 2.统计自定义数据类型
class Person {
public:
    string m_name;
    int m_age;
    Person(string name, int age)
    {
        this->m_name = name;
        this->m_age = age;
    }
    bool operator==(const Person& p)
    {

        return p.m_age == this->m_age && p.m_name == this->m_name;
    }
};
void test02()
{
    Person p1("张三", 12);
    Person p2("李四", 14);
    Person p3("张三", 12);
    Person p4("王五", 11);
    Person p5("赵六", 12);
    vector<Person> v;
    v.push_back(p1);
    v.push_back(p2);
    v.push_back(p3);
    v.push_back(p4);
    v.push_back(p5);
    int ret = count(v.begin(), v.end(), p3);
    cout << "p3出现的个数" << ret << endl;
}
int main()
{

    test02();
}

总结:统计自定义数据类型时候,需要配合operator== 

 cout_if

功能描述:
        按条件统计元素个数

#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

//常用查找算法 - count_if

// 1. 统计内置数据类型

class Mycount {
public:
    bool operator()(int val)
    {
        return val > 10;
    }
};
void test01()
{
    vector<int> v;
    v.push_back(10);
    v.push_back(20);
    v.push_back(10);
    v.push_back(30);
    v.push_back(30);
    v.push_back(40);
    int number = count_if(v.begin(), v.end(), Mycount());
    cout << "大于10的元素个数有" << number << endl;
}
// 2.统计自定义数据类型
class Person {
public:
    string m_name;
    int m_age;
    Person(string name, int age)
    {
        this->m_name = name;
        this->m_age = age;
    }
    bool operator==(const Person& p)
    {

        return p.m_age == this->m_age && p.m_name == this->m_name;
    }
};

class Mycount20 {
public:
    bool operator()(Person& p)
    {
        return p.m_age > 12;
    }
};
void test02()
{
    Person p1("张三", 12);
    Person p2("李四", 14);
    Person p3("张三", 12);
    Person p4("王五", 11);
    Person p5("赵六", 12);
    vector<Person> v;
    v.push_back(p1);
    v.push_back(p2);
    v.push_back(p3);
    v.push_back(p4);
    v.push_back(p5);
    int ret = count_if(v.begin(), v.end(), Mycount20());
    cout << "年龄在11以上的人数" << ret << endl;
}
int main()
{
    //    test01();
    test02();
}

 排序算法

学习目标:
        掌握常用的排序算法

sort排序

功能描述:
        对容器内元素进行排序

  

 

#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

//常用排序算法 sort
void printV(int val)
{
    cout << val << " ";
}
void test02()
{
    vector<int> v;
    v.push_back(10);
    v.push_back(30);
    v.push_back(0);
    v.push_back(20);
    v.push_back(50);
    sort(v.begin(), v.end());
    for_each(v.begin(), v.end(), printV);
    cout << endl;

    for (vector<int>::iterator it = v.begin(); it != v.end(); it++) {
        cout << *it << " ";
    }

    cout << endl;
    //改为降序
    sort(v.begin(), v.end(), greater<int>()); // greater变为降序
    for_each(v.begin(), v.end(), printV);
    cout <<endl;
}
int main()
{
    //    test01();
    test02();
}

总结:sort属于开发中最常用的算法之一,要熟练掌握

random_shuffle

功能描述:
        洗牌 指定范围内的元素随机调整次序

#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

//常用排序算法 sort
void printV(int val)
{
    cout << val << " ";
}
void test02()
{
    vector<int> v;
    v.push_back(10);
    v.push_back(30);
    v.push_back(0);
    v.push_back(20);
    v.push_back(50);
    for_each(v.begin(), v.end(), printV);
    cout << endl;
    //利用洗牌算法,打乱牌的顺序
    random_shuffle(v.begin(), v.end());
    for_each(v.begin(), v.end(), printV);
    cout << endl;
}
int main()
{
    srand((unsigned int)time(NULL));

    test02();
}

 merge      

功能描述:
        两个容器元素合并,并存储到另一个容器中

  

#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

//常用排序算法 merge
void printV(int val)
{
    cout << val << " ";
}
void test02()
{
    vector<int> v1;
    vector<int> v2;
    for (int i = 0; i < 5; i++) {
        v1.push_back(i);
        v2.push_back(i + 1);
    }

    for_each(v1.begin(), v1.end(), printV);
    cout << endl;
    for_each(v2.begin(), v2.end(), printV);
    cout << endl;
    //目标容器
    vector<int> vTarget;
    vTarget.resize((v1.size() + v2.size()));
    merge(v1.begin(), v1.end(), v2.begin(), v2.end(), vTarget.begin());
    for_each(vTarget.begin(), vTarget.end(), printV);
    cout<<endl;
}
int main()
{

    test02();
}

 总结:merge容器需要提前开辟空间,合并的时候必须保证两个容器都是有序序列

reverse

功能描述:
        将容器内的元素进行反转

 

#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

//常用排序算法 reverse
void printV(int val)
{
    cout << val << " ";
}
void test02()
{
    vector<int> v1;
    for (int i = 0; i < 5; i++) {
        v1.push_back(i);
    }
    for_each(v1.begin(), v1.end(), printV);
    cout << endl;
    cout << "反转后" << endl;
    reverse(v1.begin(), v1.end());
    for_each(v1.begin(), v1.end(), printV);
    cout << endl;
}
int main()
{

    test02();
}

 常用的拷贝和替换算法

学习目标:
        掌握常用的拷贝和替换算法

copy

 

#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

//常用拷贝和替换算法 copy
void printV(int val)
{
    cout << val << " ";
}
void test02()
{
    vector<int> v1;
    v1.push_back(10);
    v1.push_back(20);
    for_each(v1.begin(), v1.end(), printV);
    cout << endl;
    vector<int> v2;
    v2.resize(v1.size());
    copy(v1.begin(), v1.end(), v2.begin());

    for_each(v2.begin(), v2.end(), printV);
    cout << endl;
}
int main()
{

    test02();
}

 replace

功能描述:

        将容器内指定范围的旧元素修改为新元素

#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

//常用拷贝和替换算法 replace
void printV(int val)
{
    cout << val << " ";
}
void test02()
{
    vector<int> v1;
    v1.push_back(10);
    v1.push_back(20);
    v1.push_back(10);
    v1.push_back(30);

    for_each(v1.begin(), v1.end(), printV);
    cout << endl;
    vector<int> v2;
    cout << "替换后" << endl;
    replace(v1.begin(), v1.end(), 10, 100);
    for_each(v1.begin(), v1.end(), printV);
    cout << endl;
}
int main()
{

    test02();
}

 总结:replace会替换区间内满足条件的元素

replace_if

功能描述:
        将区间内的满足条件的元素,替换成指定元素

 

#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

//常用拷贝和替换算法 replace_if
void printV(int val)
{
    cout << val << " ";
}

class Myreplace {
public:
    bool operator()(int val)
    {
        return val > 10;
    }
};
void test02()
{
    vector<int> v1;
    v1.push_back(10);
    v1.push_back(20);
    v1.push_back(10);
    v1.push_back(30);

    for_each(v1.begin(), v1.end(), printV);
    cout << endl;
    vector<int> v2;
    cout << "替换后" << endl;
    replace_if(v1.begin(), v1.end(), Myreplace(), 100);
    for_each(v1.begin(), v1.end(), printV);
    cout << endl;
}
int main()
{

    test02();
}

 总结:按条件替换,可以利用仿函数灵活筛选满足的条件

swap

功能描述:
        互换两个容器的元素

#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

//常用拷贝和替换算法 replace_if
void printV(int val)
{
    cout << val << " ";
}

class Myreplace {
public:
    bool operator()(int val)
    {
        return val > 10;
    }
};
void test02()
{
    vector<int> v1;
    v1.push_back(10);
    v1.push_back(20);
    v1.push_back(10);
    v1.push_back(30);

    vector<int> v2;
    v2.push_back(100);
    swap(v1, v2);
    for_each(v1.begin(), v1.end(), printV);
    cout << endl;

    for_each(v2.begin(), v2.end(), printV);
    cout << endl;
}
int main()
{

    test02();
}

 常用的算数生成算法

accumlate

#include <algorithm>
#include <ctime>
#include <iostream>
#include <numeric>
#include <string>

using namespace std;
void test01()
{
    vector<int> v;
    for (int i = 0; i < 10; i++) {
        v.push_back(i);
    }
    int total = accumulate(v.begin(), v.end(), 0);//从0开始进行累加
    cout << "总和" << total << endl;
}
int main()
{
    test01();
    return 0;
}

fill

 

#include <algorithm>
#include <ctime>
#include <iostream>
#include <numeric>
#include <string>
//常用算术生成算法 fill
using namespace std;
void printV(int val)
{
    cout << val << " ";
}
void test01()
{
    vector<int> v;
    v.resize(10, 1); //设置大小,默认指定为0
    for_each(v.begin(), v.end(), printV);
    cout << endl;

    fill(v.begin(), v.end(), 100);
    for_each(v.begin(), v.end(), printV);
    cout << endl;
}
int main()
{
    test01();
    return 0;
}

 常用集合算法

set_intersection

  

#include <algorithm>
#include <ctime>
#include <iostream>
#include <numeric>
#include <string>
//常用集合算法 set_intersection 交集
using namespace std;
void printV(int val)
{
    cout << val << " ";
}
void test01()
{
    vector<int> v;
    vector<int> v1;
    vector<int> vTarget;
    for (int i = 0; i < 10; i++) {
        v.push_back(i); // 0-9
        v1.push_back(i + 5); // 5-14
    }
    //    v.push_back(10);
    cout << "v1" << endl;
    for_each(v1.begin(), v1.end(), printV);
    cout << endl;
    cout << "v" << endl;
    for_each(v.begin(), v.end(), printV);
    cout << endl;

    //提前开辟空间
    //最特殊的情况是两个取小的 开辟空间,取小容器的size
    vTarget.resize(min(v1.size(), v.size()));

    vector<int>::iterator it = set_intersection(v1.begin(), v1.end(), v.begin(), v.end(), vTarget.begin()); //返回迭代器
    for_each(vTarget.begin(), it, printV); //需要使用别人的迭代器
    cout << endl;
}
int main()
{
    test01();
    return 0;
}

 

set_union

功能描述:
        求两个集合的并集

 

 

#include <algorithm>
#include <ctime>
#include <iostream>
#include <numeric>
#include <string>
//常用集合算法 set_union 并集
using namespace std;
void printV(int val)
{
    cout << val << " ";
}
void test01()
{
    vector<int> v;
    vector<int> v1;
    vector<int> vTarget;
    for (int i = 0; i < 10; i++) {
        v.push_back(i); // 0-9
        v1.push_back(i + 5); // 5-14
    }
    vTarget.resize((v.size() + v1.size()));

    vector<int>::iterator it = set_union(v.begin(), v.end(), v1.begin(), v1.end(), vTarget.begin());
    for_each(vTarget.begin(), it, printV);
    cout << endl;
}
int main()
{
    test01();
    return 0;
}

总结:
        

set_difference

功能描述:
        求两个集合的差集

 

#include <algorithm>
#include <ctime>
#include <iostream>
#include <numeric>
#include <string>
//常用集合算法 set_difference
using namespace std;
void printV(int val)
{
    cout << val << " ";
}
void test01()
{
    vector<int> v;
    vector<int> v1;
    vector<int> vTarget;
    vector<int> vTarget2;
    for (int i = 0; i < 10; i++) {
        v.push_back(i); // 0-9
        v1.push_back(i + 5); // 5-14
    }
    vTarget.resize(max(v1.size(), v.size()));

    vector<int>::iterator it = set_difference(v.begin(), v.end(), v1.begin(), v1.end(), vTarget.begin());
    for_each(vTarget.begin(), it, printV);
    cout << endl;

    vTarget2.reserve(max(v1.size(), v.size())); //特殊情况取最大的容器空间
    vector<int>::iterator it1 = set_difference(v1.begin(), v1.end(), v.begin(), v.end(), vTarget.begin());
    for_each(vTarget.begin(), it1, printV);
    cout << endl;
}
int main()
{
    test01();
    return 0;
}

 

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【每日一题Day95】LC1815得到新鲜甜甜圈的最多组数 | 状态压缩dp 记忆化搜索

得到新鲜甜甜圈的最多组数【LC1815】 有一个甜甜圈商店&#xff0c;每批次都烤 batchSize 个甜甜圈。这个店铺有个规则&#xff0c;就是在烤一批新的甜甜圈时&#xff0c;之前 所有 甜甜圈都必须已经全部销售完毕。给你一个整数 batchSize 和一个整数数组 groups &#xff0c;数…

LeetCode刷题模版:187-189、198-200

目录 简介187. 重复的DNA序列188. 买卖股票的最佳时机 IV【未理解】189. 轮转数组198. 打家劫舍199. 二叉树的右视图200. 岛屿数量结语简介 Hello! 非常感谢您阅读海轰的文章,倘若文中有错误的地方,欢迎您指出~ ଘ(੭ˊᵕˋ)੭ 昵称:海轰 标签:程序猿|C++选手|学生 简…

【论文翻译】Attention Is All You Need

【论文】Attention is All you Need (neurips.cc) 摘要 主要的序列转换模型是基于复杂的循环或卷积神经网络&#xff0c;其中包括一个编码器和一个解码器。表现最好的模型还通过注意机制连接编码器和解码器。我们提出了一个新的简单的网络架构&#xff0c;Transformer&#xf…

线程常用方法及常见状态

终止线程应该怎么终止一个线程呢&#xff1f;当线程完成任务时。通过使用变量来控制run方法退出的方式停止线程&#xff0c;即通知方式。这里详细介绍一下2的方式。在A线程依靠变量循环跑的过程ing&#xff0c;主线程通过修改A线程的变量&#xff0c;来控制线程终止。为A线程中…

SpringBoot配置文件详解

简介 SpringBoot全局配置文件默认为src/main/resources下的application.properties&#xff0c;后缀可以改为yml&#xff0c; 如果application.yml和application.properties两个配置文件都存在&#xff0c;那么&#xff0c;properties优先级更高 官网(Spring Boot 全部配置项)&…

01_kobject和ktype创建设备文件和设备目录

总结:创建设备文件的方法 设备文件属性指的是 /sys/yyy/xxx yyy:代表这个设备的目录 xxx:代表这个驱动设备的各种属性,我们可以直接操控属性来控制这个设备 比如之前常见的 echo 5 > /sys/led/brightness 直接操作这个属性来更改led的亮度 1 创建设备kobj对象,绑定目录 k…

C语言中不定参数 ... 的语法、函数封装

文章目录Intro语法测试依赖库新函数使用测试&#xff1a;遍历并打印不定参数中的值用两种方式封装函数&#xff1a;对多个int值求和总结Intro 有一天看C代码看到某个方法有这样的定义&#xff1a;在函数形参列表处&#xff0c;有...的写法&#xff0c;就像Java中的不定参数那样…

JDK8 新特性之Stream流方法详解

目录 一&#xff1a;集合处理数据的弊端 二&#xff1a;Stream流式思想概述 小结 &#xff1a; 三&#xff1a;获取Stream流的两种方式 方式1 : 根据Collection获取流 方式2 : Stream中的静态方法of获取流 小结 四&#xff1a;Stream常用方法和注意事项 Stream常用方法…

19. 函数基础知识详解

1. 什么是函数 函数是组织好的&#xff0c;可重复使用的&#xff0c;用来实现单一&#xff0c;或相关联功能的代码段。函数能提高应用的模块性&#xff0c;和代码的重复利用率。之前文章中我们已经使用过python提供的内建函数&#xff0c;比如print()。但你也可以自己创建函数…

【JUC并发编程】线程池及相关面试题 详解

【JUC并发编程】线程池及相关面试题 详解 参考资料&#xff1a; 第十二章 线程池原理 深入浅出Java多线程原理 两道面试题&#xff0c;深入线程池&#xff0c;连环17问 深入理解Java并发编程之线程池、工作原理、复用原理及源码分析 硬核干货&#xff1a;4W字从源码上分析JUC…

Java二叉树OJ题

目录1. 检查两颗树是否相同2. 另一颗树的子树3. 翻转二叉树4. 判断一颗二叉树是否是平衡二叉树4.1 时间复杂度为O(n*n)【从上而下递归】4.2 时间复杂度为O(n)【从下而上递归】5. 对称二叉树6. 二叉树的构建及遍历7. 二叉树创建字符串8. 两个指定节点的最近公共祖先8.1 指定结点…

java入门作业-DAO,读取sql数据库

DAO意思是数据库、访问、对象。有了前后端思想。 需要下载mysql&#xff0c;并下载链接自己设置好密码。可以在navicat等软件链接打开。 材料是jc0122.sql&#xff0c;里面的admin_info是要操作的表。不像上一节需要把数据库文件放到java目录里。数据库只要在本地即可。 一、…

浅析Spring的五大类注解和方法注解

简单的将bean对象存储到Spring容器中&#xff0c;可以使用五大类注解实现&#xff0c;也可以通过Bean方法注解实现。本文重点围绕这几个问题展开&#xff1a;1.为什么需要五大类注解&#xff1f;2.五大类注解之间有没有关系&#xff1f;3.Spring使用五大类注解生成beanName问题…

Linux常见命令 17 - 帮助命令 man,whatis,--help,info,help

目录 1. 查看命令/配置文件帮助信息 man 2. 查看简短的命令帮助信息 whatis 3. 查看简短的命令选项信息 --help 4. 另一查看命令文件帮助信息 info 5. Shell内置帮助命令 help 1. 查看命令/配置文件帮助信息 man [1] 语法&#xff1a;man [命令] 示例&#xff1a;如果想要查…

分享129个ASP源码,总有一款适合您

ASP源码 分享129个ASP源码&#xff0c;总有一款适合您 下面是文件的名字&#xff0c;我放了一些图片&#xff0c;文章里不是所有的图主要是放不下...&#xff0c; 129个ASP源码下载链接&#xff1a;https://pan.baidu.com/s/1dUPOSf1BudsK-bB4FnGXfQ?pwdg3ae 提取码&#x…

黑马2021-8Vue自学笔记hm

黑马2021-8Vue教程学习笔记 文章目录黑马2021-8Vue教程学习笔记代码和笔记不断更新gitee代码仓库地址备用前端gei忽略提交文件webpack的使用初始化包管理配置文件 package.json下载webpack解决问题dependencies 和 devDependencies区别:在项目中配置webpackWebpack 中的默认约定…

python基础——列表推导式

python基础——列表推导式 文章目录python基础——列表推导式一、实验目的二、实验原理三、实验环境四、实验内容五、实验步骤一、实验目的 掌握Python数据结构&#xff1a;列表推导式的用法。 二、实验原理 列表推导式&#xff08;list comprehension&#xff09;列表推导式…

【Python百日进阶-Web开发-Linux】Day235 - Win11的WSL2中安装Docker

文章目录一、Docker是什么二、Win11安装Docker2.1 官网下载2.2 系统要求&#x1f517;2.2.1 WSL 2 后端2.2.2 Hyper-V 后端和 Windows 容器2.2.3 关于 Windows 容器2.3 在 Windows 上安装 Docker Desktop2.3.1 交互式安装2.3.2 从命令行安装2.4 启动 Docker 桌面三、WSL2的Ubun…

ConcurrentHashMap的死循环问题

文章目录前言1. 情景复现2. 源码解析3. 代码调试4. 原因5. 解决前言 对于ConcurrentHashMap来说&#xff0c;能保证多线程下的安全问题&#xff0c;但是在JDK1.8中还是会出现一个bug&#xff0c;就是computeIfAbsent&#xff0c;下面就来详细说说死循环的原因 1. 情景复现 首…

进阶C语言 第二章-------《进阶指针》 (指针数组、数组指针、函数指针、回调指针)知识点+基本练习题+深入细节+通俗易懂+完整思维导图+建议收藏

绪论 书接上回&#xff0c;通过对数据类型进阶的认识&#xff0c;你肯定对各种数据类型在内存中如何存储有了了解。虽然说&#xff0c;这方面可能对你的编程能力没什么进步。但是&#xff0c;他是一本内功秘籍&#xff0c;当我们遇到了这方面的问题时我们可以知道可能是哪一方面…