202/12/10 基础算法每日5道详解

news2024/9/23 13:27:24

21. Merge Two Sorted Lists合并两个排序列表

You are given the heads of two sorted linked lists list1 and list2.
Merge the two lists in a one sorted list. The list should be made by splicing together the nodes of the first two lists.
Return the head of the merged linked list.
给你两个排序的链表list1 和list2 的头。
将两个列表合并到一个排序列表中。
返回合并链表的头部。

Example 1:

https://assets.leetcode.com/uploads/2020/10/03/merge_ex1.jpg

Input: list1 = [1,2,4], list2 = [1,3,4]
Output: [1,1,2,3,4,4]

Example 2:

Input: list1 = [], list2 = []
Output: []

Example 3:

Input: list1 = [], list2 = [0]
Output: [0]

代码实现

package com.xu.leecode.practise1;

import practise7.Stack;

public class MergeTwoSortedLists {
    public static void main(String[] args) {
        // 创建第一个链表
        ListNode l1 = new ListNode(1);
        l1.next = new ListNode(2);
        l1.next.next = new ListNode(4);

        //创建第二个链表
        ListNode l2 = new ListNode(1);
        l2.next = new ListNode(3);
        l2.next.next = new ListNode(4);

        MergeTwoSortedLists mergeTwoSortedLists = new MergeTwoSortedLists();
        ListNode mergedList = mergeTwoSortedLists.mergeTwoLists(l1, l2);

        // 打印合并列表
        while (mergedList != null) {
            System.out.print(mergedList.val + " -> ");
            mergedList = mergedList.next;
        }
        System.out.println("null");
    }



     //单向链表的定义
      public static class ListNode {
          int val;
          ListNode next;
          ListNode() {}
          ListNode(int val) { this.val = val; }
          ListNode(int val, ListNode next) { this.val = val; this.next = next; }
      }

    public ListNode mergeTwoLists(ListNode l1, ListNode l2) {
        // 创建一个新的ListNode作为合并后链表的头部
        ListNode head = new ListNode(-1);
        // 创建一个对当前添加到合并链表的节点的引用
        ListNode curr = head;

        // 当l1和l2中仍有元素时
        while (l1 != null && l2 != null) {
            // 如果l1的当前元素比l2的当前元素小
            if (l1.val < l2.val) {
                // 将l1的当前元素添加到合并链表中
                curr.next = l1;
                // 移动到l1的下一个元素
                l1 = l1.next;
            } else {
                // 将l2的当前元素添加到合并链表中
                curr.next = l2;
                // 移动到l2的下一个元素
                l2 = l2.next;
            }
            // 移动到合并链表的下一个元素
            curr = curr.next;
        }

        // 如果在遍历完l2后l1中还有剩余元素
        if (l1 != null) {
            // 将l1中剩余的元素添加到合并链表中
            curr.next = l1;
        }
        // 如果在遍历完l1后l2中还有剩余元素
        if (l2 != null) {
            // 将l2中剩余的元素添加到合并链表中
            curr.next = l2;
        }

        // 返回合并链表,排除虚拟头节点
        return head.next;
    }

}

结果:

1 -> 1 -> 2 -> 3 -> 4 -> 4 -> null

首先,在两个链表都不为空的情况下,判断两个链表当前元素的大小,将值较小的元素添加到合并链表中,并将当前元素后移。然后递归地调用 mergeTwoLists() 函数,直到两个链表中有一个为空。
如果在遍历完一个链表后,另一个链表中还有剩余元素,则将剩余的元素添加到合并链表的末尾。
最后,返回合并链表的头部。

class Solution {
    // 合并两个有序链表
    public ListNode mergeTwoLists(ListNode list1, ListNode list2) {
        // 如果list1为空,则返回list2
        if(list1 == null) return list2;
        // 如果list2为空,则返回list1
        if(list2 == null) return list1;
        // 如果list1的当前元素比list2的当前元素小
        if(list1.val < list2.val){
            // 将list1的下一个元素和list2中的元素合并
            list1.next = mergeTwoLists(list1.next, list2);
            // 返回list1
            return list1;
        } else{
            // 将list1和list2的下一个元素合并
            list2.next = mergeTwoLists(list1, list2.next);
            // 返回list2
            return list2;
        }
    }
}

26. Remove Duplicates from Sorted Array从排序数组中删除重复项

Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same.
Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if there are k elements after removing the duplicates, then the first k elements of nums should hold the final result. It does not matter what you leave beyond the first k elements.
Return k after placing the final result in the first k slots of nums.
Do not allocate extra space for another array. You must do this by modifying the input array in-place with O(1) extra memory.
给定一个按非递减顺序排序的整数数组 nums,就地删除重复项,使每个唯一元素只出现一次。元素的相对顺序应保持不变。
由于在某些语言中无法更改数组的长度,因此您必须将结果放在数组 nums 的第一部分。更正式地说,如果删除重复项后有 k 个元素,则 nums 的前 k 个元素应该保存最终结果。在前 k 个元素之外留下什么并不重要。
将最终结果放入 nums 的前 k 个槽后返回 k。
不要为另一个数组分配额外的空间。您必须通过使用 O(1) 额外内存就地修改输入数组来做到这一点。

Example 1:

Input: nums = [1,1,2]
Output: 2, nums = [1,2,_]
Explanation: Your function should return k = 2, with the first two elements of nums being 1 and 2 respectively.
It does not matter what you leave beyond the returned k (hence they are underscores).

Example 2:

Input: nums = [0,0,1,1,1,2,2,3,3,4]
Output: 5, nums = [0,1,2,3,4,_,_,_,_,_]
Explanation: Your function should return k = 5, with the first five elements of nums being 0, 1, 2, 3, and 4 respectively.
It does not matter what you leave beyond the returned k (hence they are underscores).

代码实现:



public class RemoveDuplicates {
    public static void main(String[] args) {
        int[] nums = {1, 1, 2, 3, 3, 4, 5};
        RemoveDuplicates solution = new RemoveDuplicates();
        int length = solution.removeDuplicates(nums);
        System.out.println(length);

    }
    public int removeDuplicates(int[] nums) {
        // 如果数组为空或者数组长度为1,则无需处理,直接返回数组长度
        if (nums == null || nums.length == 1) return nums.length;

        // 从第2个元素开始遍历数组
        int i = 1;
        for (int j = 1; j < nums.length; j++) {
            // 如果当前元素与上一个元素不相同
            if (nums[j] != nums[j - 1]) {
                // 将当前元素复制到第i个位置,并将i后移1
                nums[i] = nums[j];
                i++;
            }
        }

        // 返回不重复的元素的个数
        return i;
    }


}

Leecode代码:

class Solution {
public int removeDuplicates(int[] nums) { // 定义一个方法,接收一个整数数组,返回一个整数
        if (nums.length == 0) return 0; // 如果数组长度为0,则直接返回0
        int i = 0; // 定义变量i,表示当前可插入的位置
        for (int j = 1; j < nums.length; j++) { // 从1开始循环到数组末尾
            if (nums[j] != nums[i]) { // 如果nums[j]和nums[i]不同
                i++; // 当前可插入的位置向后移一位
                nums[i] = nums[j]; // 将nums[j]插入到当前位置
            }
        }
        return i + 1; // 返回数组长度
}

运行结果:

5

27. Remove Element移除元素

Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The relative order of the elements may be changed.
Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if there are k elements after removing the duplicates, then the first k elements of nums should hold the final result. It does not matter what you leave beyond the first k elements.
Return k after placing the final result in the first k slots of nums.
Do not allocate extra space for another array. You must do this by modifying the input array in-place with O(1) extra memory.
给定一个整数数组 nums 和一个整数 val,就地删除 nums 中所有出现的 val。元素的相对顺序可能会改变。
由于在某些语言中无法更改数组的长度,因此您必须将结果放在数组 nums 的第一部分。更正式地说,如果删除重复项后有 k 个元素,则 nums 的前 k 个元素应该保存最终结果。在前 k 个元素之外留下什么并不重要。
将最终结果放入 nums 的前 k 个槽后返回 k。
不要为另一个数组分配额外的空间。您必须通过使用 O(1) 额外内存就地修改输入数组来做到这一点。

Custom Judge:

The judge will test your solution with the following code:

int[] nums = [...]; // Input array
int val = ...; // Value to remove
int[] expectedNums = [...]; // The expected answer with correct length.
                            // It is sorted with no values equaling val.

int k = removeElement(nums, val); // Calls your implementation

assert k == expectedNums.length;
sort(nums, 0, k); // Sort the first k elements of nums
for (int i = 0; i < actualLength; i++) {
    assert nums[i] == expectedNums[i];
}

If all assertions pass, then your solution will be accepted.

Example 1:

Input: nums = [3,2,2,3], val = 3
Output: 2, nums = [2,2,_,_]
Explanation: Your function should return k = 2, with the first two elements of nums being 2.
It does not matter what you leave beyond the returned k (hence they are underscores).

Example 2:

Input: nums = [0,1,2,2,3,0,4,2], val = 2
Output: 5, nums = [0,1,4,0,3,_,_,_]
Explanation: Your function should return k = 5, with the first five elements of nums containing 0, 0, 1, 3, and 4.
Note that the five elements can be returned in any order.
It does not matter what you leave beyond the returned k (hence they are underscores).

代码实现:

package com.xu.leecode.practise1;

public class RemoveElement {

        public int removeElement(int[] nums, int val) {
            if (nums == null || nums.length == 0) return 0;

                     // 从头开始遍历数组
            for (int j = 0; j < nums.length; j++) {
                // 如果当前元素与指定值不相同
                if (nums[j] != val) {
                    // 将当前元素复制到第i个位置,并将i后移1
                    nums[i] = nums[j];
                    i++;
                }
            }

            // 返回新数组的长度
            return i;
        }

        public static void main(String[] args) {
            int[] nums = {1, 2, 3, 4, 5, 6, 7, 8, 9,9};
            RemoveElement solution = new RemoveElement();
            int length = solution.removeElement(nums, 9);

            System.out.println("新数组长度:" + length);
            for (int i = 0; i < length; i++) {
                System.out.print(nums[i] + " ");
            }
            System.out.println();
        }


}

Leecode代码实现:

class Solution {
	public int removeElement(int[] nums, int val) { // 定义一个方法,接收一个整数数组和一个要移除的整数值,返回一个整数
        int i = 0; // 定义变量i,表示当前可插入的位置
        for (int j = 0; j < nums.length; j++) { // 从0开始循环到数组末尾
            if (nums[j] != val) { // 如果nums[j]不等于val
                nums[i] = nums[j]; // 将nums[j]插入到当前位置
                i++; // 当前可插入的位置向后移一位
            }
        }
        return i; // 返回数组长度
    }
}

运行结果:

新数组长度:8
1 2 3 4 5 6 7 8 

28. Implement strStr()实现 strStr()

Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
Clarification:
What should we return when needle is an empty string? This is a great question to ask during an interview.
For the purpose of this problem, we will return 0 when needle is an empty string. This is consistent to C’s strstr() and Java’s
indexOf().
给定两个字符串 needle 和 haystack,返回 haystack 中第一次出现 needle 的索引,如果 needle 不是 haystack 的一部分,则返回 -1。
当 needle 为空字符串时,我们应该返回什么?
针对这个问题,当needle为空字符串时,我们将返回0,这与C的strstr()和Java的indexOf()是一致的。

Example 1:

Input: haystack = "hello", needle = "ll"
Output: 2

Example 2:

Input: haystack = "aaaaa", needle = "bba"
Output: -1

代码实现:

package com.xu.leecode.practise1;

public class strStr {
    public int strStr(String haystack, String needle) {
        if (haystack == null || needle == null) return -1;

        // 计算needle长度
        int needleLength = needle.length();
        // 如果needle为空串,则直接返回0
        if (needleLength == 0) return 0;

        // 计算haystack长度
        int haystackLength = haystack.length();
        // 如果needle长度大于haystack长度,则一定无法找到needle
        if (needleLength > haystackLength) return -1;

        // 循环遍历haystack
        for (int i = 0; i < haystackLength; i++) {
            // 如果当前字符不是needle的第一个字符,则继续循环
            if (haystack.charAt(i) != needle.charAt(0)) continue;

            // 如果当前字符刚好是haystack末尾,则无法找到needle
            if (i == haystackLength - 1) return -1;

            // 如果haystack剩下的长度小于needle的长度,则无法找到needle
            if (haystackLength - i < needleLength) return -1;

            // 比较haystack[i+1]到haystack[i+needleLength]与needle[1]到needle[needleLength]是否相同
            boolean found = true;
            for (int j = 1; j < needleLength; j++) {
                if (haystack.charAt(i + j) != needle.charAt(j)) {
                    found = false;
                    break;
                }
            }

            // 如果找到了,则返回needle在haystack中出现的位置
            if (found) return i;
        }

        // 没找到,返回-1
        return -1;
    }

    public static void main(String[] args) {
        strStr solution = new strStr();

        String haystack = "aaaaa";
        String needle = "bba";
        int result = solution.strStr(haystack, needle);
        System.out.println(result);

    }
}

Leecode代码实现:

class Solution {
    public int strStr(String haystack, String needle) { // 定义一个方法,接收两个字符串,返回一个整数
        if (needle.equals("") || needle.equals(haystack)) return 0; // 如果needle为空或者等于haystack,则返回0

        int hLen = haystack.length(), nLen = needle.length(); // 取出两个字符串的长度
        if (nLen > hLen) return -1; // 如果needle长度大于haystack,则返回-1

        for (int i = 0; i <= hLen - nLen; i++) { // 从0开始循环到haystack末尾
            if (haystack.substring(i, i + nLen).equals(needle)) return i; // 如果haystack的i到i+nLen的子串等于needle,则返回i
        }

        return -1; // 否则返回-1
    }

    public static void main(String[] args) {
        Solution solution = new Solution();

        String haystack = "hello";
        String needle = "ll";
        int result = solution.strStr(haystack, needle);
        System.out.println(result);

        haystack = "aaaaa";
        needle = "bba";
        result = solution.strStr(haystack, needle);
        System.out.println(result);
    }
}

        
    

运行结果:

-1

35. Search Insert Position搜索插入位置

Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You must write an algorithm with O(log n) runtime complexity.
给定一个由不同整数组成的排序数组和一个目标值,如果找到目标,则返回索引。
如果不是,则返回按顺序插入的索引。
您必须编写一个具有 O(log n) 运行时复杂度的算法。

Example 1:

Input: nums = [1,3,5,6], target = 5
Output: 2

Example 2:

Input: nums = [1,3,5,6], target = 2
Output: 1

Example 3:

Input: nums = [1,3,5,6], target = 7
Output: 4

代码实现:

package com.xu.leecode.practise1;

public class SearchInsertPosition {
    public int searchInsert(int[] nums, int target) {
        if (nums == null || nums.length == 0) return -1; // 如果nums为null或者长度为0,则返回-1

        int left = 0; // 定义搜索区间的左端点
        int right = nums.length - 1; // 定义搜索区间的右端点

        while (left <= right) { // 当左端点小于等于右端点时,继续循环
            int mid = left + (right - left) / 2; // 计算搜索区间的中间位置

            if (nums[mid] == target) return mid; // 如果nums[mid]等于target,则直接返回mid
            else if (nums[mid] < target) left = mid + 1; // 如果nums[mid]小于target,则搜索区间缩小到[mid + 1, right]
            else right = mid - 1; // 如果nums[mid]大于target,则搜索区间缩小到[left, mid - 1]
        }

        // 如果没有找到,则返回应该插入的位置
        return left;
    }

    public static void main(String[] args) {
        SearchInsertPosition solution = new SearchInsertPosition();

        int[] nums = new int[]{1, 3, 5, 6}; // 定义排好序的整数数组
        int target = 5; // 定义查询的目标值
        int result = solution.searchInsert(nums, target); // 查询并获得结果
        System.out.println(result); // 输出结果

        target = 1; // 定义查询的目标值
        result = solution.searchInsert(nums, target); // 查询并获得结果
        System.out.println(result); // 输出结果
    }
}

Leecode代码实现:

class Solution {
    public int searchInsert(int[] nums, int target) { // 定义一个方法,接收一个整数数组和一个目标整数,返回一个整数
        for (int i = 0; i < nums.length; i++) { // 从0开始循环到数组末尾
            if (nums[i] >= target) return i; // 如果nums[i]大于等于target,则返回i
        }
        return nums.length; // 否则返回数组长度
    }

    public static void main(String[] args) {
        Solution solution = new Solution();

        int[] nums = new int[] {1, 3, 5, 6};
        int target = 5;
        int result = solution.searchInsert(nums, target);
        System.out.println(result);

        nums = new int[] {1, 3, 5, 6};
        target = 2;
        result = solution.searchInsert(nums, target);
        System.out.println(result);

        nums = new int[] {1, 3, 5, 6};
        target = 7;
        result = solution.searchInsert(nums, target);
        System.out.println(result);
    }
}

运行结果:

2
0

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

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

相关文章

Java基于springboot的人职匹配推荐系统-计算机毕业设计

项目介绍 随着科学技术的飞速发展&#xff0c;各行各业都在努力与现代先进技术接轨&#xff0c;通过科技手段提高自身的优势&#xff1b;对于人职匹配推荐系统当然也不能排除在外&#xff0c;随着网络技术的不断成熟&#xff0c;带动了人职匹配推荐系统&#xff0c;它彻底改变…

[附源码]计算机毕业设计基于人脸识别的社区防疫管理系统Springboot程序

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

字节管理薪资被应届生倒挂7K,这真的是不把老员工当人?

一位字节跳动的小管理爆出&#xff0c;无意中看到了整个部门薪资&#xff0c;本以为自己算比较高的&#xff0c;但看完之后整个人都傻眼了。小组长的职位月薪28K&#xff0c;而手下组员却是35K&#xff0c;当天晚上抽了一包烟也没想明白是为什么。 楼主表示&#xff0c;自己是字…

算法基础篇-05-排序-LowB三人组(冒泡/选择/插入排序)

1. LowB 三人组介绍 LowB 三人组的时间复杂度都是 O(n^2) 1.1 冒泡排序(Bubble Sort) 列表每2个相邻的数&#xff0c;如果前面比后面大&#xff0c;则交换这两个数。一趟排序完成后&#xff0c;则无序区减少一个数&#xff0c;有序区增加一个数&#xff1b;时间复杂度 O(n^2…

Linux 伙伴系统

Linux 伙伴系统前言一、rmqueue1.1 流程图1.2 函数原型1.3 通过PCP分配1.4 大阶页面分配二、__rmqueue2.1 流程图三、__rmqueue_pcplist3.1 流程图四、__rmqueue_fallback五、__rmqueue_smallest5.1 源码5.1.1 get_page_from_free_area5.1.2 del_page_from_free_list5.1.3 expe…

从零开始把 SpringBoot 搬到 K8s 上运行,我用了这几步!

前言 大家好&#xff0c;我是网管。咱们的 K8s 入门和实践&#xff0c;在经历了三篇理论知识的后&#xff0c;相信各位都已经期待许久&#xff08;可能的吧&#xff09;&#xff0c;就差私信我&#xff0c;你整着理论整半天有啥用&#xff0c;本大人写的程序怎么能放到 K8s 上运…

Istio初探

Istio初探 前置环境&#xff1a;docker 一、安装k8s&#xff1a; ● https://segmentfault.com/a/1190000042204035 1、 https://github.com/gotok8s/k8s-docker-desktop-for-mac.git 2、 https://github.com/kubernetes/dashboard 3、 获取token curl ‘http://127.0.0.1:80…

SpringBoot实战项目杂货铺主页统计图表(折线图、饼状图、条形图)

统计图表的制作我们用到了Echarts&#xff0c;不得不说Echarts真的是百度的超级良心产品了。打Call!!!&#x1f44d;&#x1f44d;&#x1f44d; ✔小插曲&#xff1a; 这里博主顺带提一下&#xff0c;像处理访问量等等数据的时候&#xff0c;往往会涉及到一个并发问题。举个…

ADI Blackfin DSP处理器-BF533的开发详解27:扩展IO输出的详细讲解(含源代码)

硬件准备 ADSP-EDU-BF533&#xff1a;BF533开发板 AD-HP530ICE&#xff1a;ADI DSP仿真器 软件准备 Visual DSP软件 硬件链接 硬件设计原理图 功能介绍 ADSP-EDU-BF53x 开发板上扩展接口的 PPORT3 中引出了 4 个扩展 IO 接口输出接口&#xff0c;这些连接到了 CPLD&#x…

【大数据入门核心技术-Hadoop】(八)Hadoop基本管理命令行

目录 一、 三种shell命令方式 二、常见Shell操作命令 三、dfs管理命令行 1、当前haoop环境变量 2、当前集群节点信息 3、运行HTTPFS服务器 4、高可用节点管理 5、单独启动某个节点服务 四、更多命令 一、 三种shell命令方式 HDFS有三种shell命令方式 hadoop fs&#…

flink部署-1.14

1. 版本说明 本文档内容基于 flink-1.14.x&#xff0c;其他版本的整理&#xff0c;请查看本人博客的 flink 专栏其他文章。 2. 概述 Flink 是一种通用性框架&#xff0c;支持多种不同的部署方式。 本章简要介绍 Flink 集群的组成部分、用途和可用实现。如果你只是想在本地启…

线程死锁、锁死、饥饿、活锁讲解

文章目录死锁哲学家就餐问题死锁的检测方式死锁的产生条件死锁的规避死锁的恢复锁死信号丢失锁死嵌套监视器锁死线程饥饿活锁死锁 概念 如果两个或者更多的线程因为相互等待对方而被永远暂停&#xff0c;线程的生命周期变成了BLOCKED或者WAITING&#xff0c;则我们称这些线程产…

计算机-校验码

码距:就单个编码A:00而言&#xff0c;其码距为1&#xff0c;因为其只需要改变一位就变成另一个编码。在两个编码中&#xff0c;从A码到B码转换所需要改变的位数称为码距&#xff0c;如A:00要转换为B:11&#xff0c;码距为2。一般来说&#xff0c;码距越大&#xff0c;越利于纠错…

基于C++实现(控制台)仓库管理系统【100010021】

1题目与要求 1.1问题描述 某电子公司仓库中有若干批次的同一种电脑&#xff0c;按价格、数量来存储。要求实现功能: 初始化 n 批不同价格电脑入库&#xff1b;出库&#xff1a;销售 m 台价格为 p 的电脑&#xff1b;入库&#xff1a;新到 m 台价格为 p 的电脑&#xff1b;盘…

Burp Suite Professional 22.11.4 Crack

Burp Suite Professional 是网络安全测试人员的首选工具包。使用它来自动执行重复的测试任务 - 然后使用其专家设计的手动和半自动安全测试工具进行更深入的挖掘。Burp Suite Professional 可以帮助您测试 OWASP Top 10 漏洞 Burp Suite 被描述为通过 Port Swigger 提供给用户…

Python学习基础笔记三十七——collections模块

1、collections模块&#xff1a; 内置数据类型&#xff1a;列表list、字典dict、集合set、元组tuple。 Collections模块提供了另外的数据类型&#xff1a; 队列deque、双端队列&#xff1a;可以快速地从另外一侧追加和推出元素&#xff1b; namedtuple&#xff1a; 生成可以…

游戏开发53课 阴影

4.8 阴影 阴影的实现方式有很多种&#xff0c;消耗和效果各异。 4.8.1 贴图阴影 贴图的方式最简单&#xff0c;做法是制作一张阴影纹理&#xff0c;放到物体脚下&#xff08;下图&#xff09;&#xff0c;跟随物体一起运动。 贴图阴影渲染非常简单&#xff0c;只需要两个三角…

智能聊天机器人技术研究与应用

文章大纲 1. 聊天机器人简介聊天机器人进化历史聊天机器人核心技术2. 预训练模型与聊天机器人研究进展transfomer 架构回顾预训练对话模型3. 知识图谱与智能问答4. 智能聊天机器人应用实践5. 总结与展望正确使用chatGPT“高端的食材往往只需要最朴素的烹饪方式”参考文献与学习…

OpenFeign使用

OpenFeign使用 在微服务的架构中&#xff0c;传统的http客户端如Httpclient Okhttp HttpURLConnection RestTemplate WebClient 显然不适合。毕竟需要动态的获取服务地址&#xff0c;和进行负载均衡调用。 RPC框架 PC 全称是 Remote Procedure Call &#xff0c;即远程过程调…

NTC-Templates解析与采集H3C(Comware Version 7)信息

本文仅供本人参考与学习NTC-Templates模板使用。 设备环境&#xff1a;HCL S6850 S5820V2-54QS-GE&#xff1b;Version 7.1.075, Alpha 7571 模板采用&#xff1a;hp_comware_display_xxxxxxxx.textfsm 在线模板测试&#xff1a;https://textfsm.nornir.tech/ hp_comware_d…