深信服面试常见算法题整理笔记

news2024/10/6 18:30:47

⭐️我叫恒心,一名喜欢书写博客的研究生在读生。

原创不易~转载麻烦注明出处,并告知作者,谢谢!!!

这是一篇近期会不断更新的博客欧~~~ 有什么问题的小伙伴 欢迎留言提问欧。

在这里插入图片描述

文章目录

    • 1 反转链表
    • 2 排序
    • 3 设计LRU缓存结构
    • 4 最小K个数
    • 5 求二叉树的层次遍历
    • 6 **NC33** **合并两个排序的链表**
    • 7 **用两个栈实现队列**
    • 8 跳台阶
    • 9 求连续子数组的最大和
    • 10 判断一个链表是否有环
    • 11 删除链表倒数第K个节点(已经考了)
    • 12 大小端
    • 13 二叉树公共祖先
    • 14 二叉搜素树的公共祖先
    • 15 **字符串出现次数的TopK问题**
    • 16 加起来和位目标值的组合(二)
    • 17 连续子数组的最大乘积
    • 18 设计一个循环数组

1 反转链表

class Solution {
public:
    ListNode* ReverseList(ListNode* pHead) {
        ListNode* newHead = nullptr;
        while(pHead){
            ListNode* nex = pHead->next;
            pHead->next = newHead;
            newHead = pHead;
            pHead = nex;
        }
        return newHead;
    }
}

递归的形式

class Solution {
  public:
    ListNode* ReverseListCore(ListNode* node) {
        if (node == nullptr || node->next == nullptr) return node;
        ListNode* nexHead = node->next;
        ListNode* newHead = ReverseListCore(nexHead);
        nexHead->next = node;
        node->next = nullptr;
        return newHead;
    }

    ListNode* ReverseList(ListNode* pHead) {
        return  ReverseListCore(pHead);
    }
};

2 排序

堆排序

class Solution {
public:
    /**
     * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
     * 将给定数组排序
     * @param arr int整型vector 待排序的数组
     * @return int整型vector
     */
    void quickSort(vector<int>& num, int begin, int end){
        if(begin > end) return ;
        int low = begin;
        int high = end;
        int key = num[begin];
        while(low < high){
            // 跟右边进行比较
            while(low < high && key <= num[high]){
                high--;
            }
            if(low < high) num[low++] = num[high];
            while(low < high && key >= num[low]){
                low++;
            }
            if(low < high) num[high--] = num[low];
        }
        num[low] = key;
        quickSort(num, begin, low-1);
        quickSort(num, low+1, end);
    }
    
    void heapfy(vector<int>& arr, int i, int n){
        if(i >= n) return ;
        int c1 = 2*i + 1;
        int c2 = 2*i + 2;
        int max = i;
        if(c1 < n && (arr[c1] > arr[max])) max = c1;
        if(c2 < n && (arr[c2] > arr[max])) max = c2;
        if(max != i){
            swap(arr[max],arr[i]);
            heapfy(arr,max,n);
        }
    }
    
    void build_heap(vector<int>& arr, int n){
        int parent = (n-2) / 2;
        for(int i = parent; i>=0; --i){
            heapfy(arr,i,n);
        }
    }
    
    void heapSort(vector<int>& arr){
        int n = arr.size();
        build_heap(arr,n);
        for(int i = n-1; i >=0; --i){
            cout<<arr[0]<<endl;
            swap(arr[0],arr[i]);
            heapfy(arr,0,i);
        }
        
    }
    
    vector<int> MySort(vector<int>& arr) {
        // write code here
        // 快速排序
        int n = arr.size();
        //quickSort(arr,0,n-1);
        heapSort(arr);
        return arr;
    }
};

3 设计LRU缓存结构

#include<iostream>
#include<unordered_map> 
#include<algorithm>
using namespace std;

//这里放你的代码
struct DKLinkNode{
    int key,value;
    DKLinkNode* next;
    DKLinkNode* pre;
    DKLinkNode():key(0),value(0),pre(nullptr),next(nullptr){}
    DKLinkNode(int _key, int _val):key(_key),value(_val),pre(nullptr),next(nullptr){}
};

class LRUCache {
private:
    // 借助哈希表来查询存储的位置,key value(链表节点)
    unordered_map<int, DKLinkNode*> cache;
    int capacity;
    int size;
    DKLinkNode* head;
    DKLinkNode* tail;
public:
    LRUCache(int _capacity):capacity(_capacity),size(0) {
        // 创建头尾 伪节点 便于定位
        head = new DKLinkNode();
        tail = new DKLinkNode();
        head->next = tail;
        tail->pre = head;
    }
    
    ~LRUCache(){
    	if(head != nullptr){
    		delete head;
    		head = nullptr;
		}
		if(tail != nullptr){
			delete tail;
			tail = nullptr;
		}
		for(auto& c : cache){
			if(c.second != nullptr){
				delete c.second;
				c.second = nullptr;
			}
		}
	}
    
    int get(int key) {
        // 如果双向链表中没有这个节点则直接返回
        if(!cache.count(key)){return -1;}
        // 如果有节点 则通过哈希表获取这个节点的地址,将这个节点移到前面
        DKLinkNode* node = cache[key];
        moveToHead(node);
        return node->value;
    }
    
    void put(int key, int value) {
        // 如果哈希表查找不到这个key 则插入新的值到哈希表中
            // 将新的值插入双向链表的头部
        if(!cache.count(key)){
            DKLinkNode* node = new DKLinkNode(key, value);
            cache[key] = node;
            addHeadNode(node);
            ++size;
            // 如果当前的容量大于缓存的最大容量,则移除某段节点
            if(size > capacity){
                DKLinkNode* rNode = removeTail();
                cache.erase(rNode->key);
                delete rNode;
                --size;
            }
        }else{
            // 如果查找得到key,则将该节点移动到头部
            DKLinkNode* moveNode = cache[key];
            // 更新当前key对应的value 并移动链表
            moveNode->value = value;
            moveToHead(moveNode);
        }
    }

    void addHeadNode(DKLinkNode* node){
        node->pre = head;
        node->next = head->next;
        head->next->pre = node;
        head->next  = node;
    }

    void removeNode(DKLinkNode* rNode){
        rNode->pre->next = rNode->next;
        rNode->next->pre = rNode->pre;
    }

    DKLinkNode* removeTail(){
        DKLinkNode* rNode = tail->pre;
        removeNode(rNode);
        return rNode; 
    }

    void moveToHead(DKLinkNode* node){
        // 删除当前节点
        removeNode(node);
        // 在头结点处添加进去
        addHeadNode(node);
    }
};

int main(){
	LRUCache* cache = new LRUCache(2);
	cache->put(1, 1);
	cache->put(2, 2);
	int res = cache->get(1);       // 返回  1
	cout<<res<<endl;
	cache->put(3, 3);    // 该操作会使得密钥 2 作废
	res = cache->get(2);       // 返回 -1 (未找到)
	cache->put(4, 4);    // 该操作会使得密钥 1 作废
	res = cache->get(1);       // 返回 -1 (未找到)
	cout<<res<<endl;
	res = cache->get(3);       // 返回  3
	cout<<res<<endl;
	res = cache->get(4);       // 返回  4
	cout<<res<<endl;
	return 0;
} 

4 最小K个数

class Solution {
public:
    vector<int> GetLeastNumbers_Solution(vector<int> input, int k) {
        vector<int> res;
        if(input.size() == 0 || k == 0) return res;
        // 利用最小堆来做。
        priority_queue<int, vector<int>, greater<int>> minHeap;
        for(auto num : input){
            minHeap.push(num);
        }
        while(k--){
            res.push_back(minHeap.top());
            minHeap.pop();
        }
        return res;
    }
};

最小k个数 应该用大根堆来做

class Solution {
public:
    vector<int> GetLeastNumbers_Solution(vector<int> input, int k) {
        vector<int> ret;
        if (k==0 || k > input.size()) return ret;
        priority_queue<int, vector<int>> pq;
        for (const int val : input) {
            if (pq.size() < k) {
                pq.push(val);
            }
            else {
                if (val < pq.top()) {
                    pq.pop();
                    pq.push(val);
                }

            }
        }

        while (!pq.empty()) {
            ret.push_back(pq.top());
            pq.pop();
        }
        return ret;
    }
};

5 求二叉树的层次遍历

/**
 * struct TreeNode {
 *  int val;
 *  struct TreeNode *left;
 *  struct TreeNode *right;
 * };
 */

class Solution {
  public:
    /**
     *
     * @param root TreeNode类
     * @return int整型vector<vector<>>
     */
    vector<vector<int> > levelOrder(TreeNode* root) {
        // write code here
        vector<vector<int>> res;
        if (root == nullptr) return res;
        queue<TreeNode*> q;
        q.push(root);
        while (!q.empty()) {
            int q_size = q.size();
            vector<int> temp;
            while (q_size--) {
                TreeNode* node = q.front();
                temp.push_back(node->val);
                q.pop();
                if (node->left) q.push(node->left);
                if (node->right) q.push(node->right);
            }
            res.push_back(temp);
        }
        return res;
    }
};

6 NC33 合并两个排序的链表

class Solution {
public:
    ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {
        if(l1 == nullptr) return l2;
        if(l2 == nullptr) return l1;
        ListNode* dummy = new ListNode(0);
        ListNode* cur = dummy;
        while(l1 && l2){
            if(l1->val <= l2->val){
                cur->next = l1;
                cur = l1;
                l1 = l1->next;
            }else if(l1->val > l2->val){
                cur->next = l2;
                cur = l2;
                l2 = l2->next;
            }
        }
        if(l1!=nullptr){
            cur->next = l1;
        }else if(l2 != nullptr){
            cur->next = l2;
        }
        return dummy->next;
    }
};

7 用两个栈实现队列

class Solution
{
public:
    void push(int node) {
        stack1.push(node);
    }

    int pop() {
        // 借助辅助栈完成 
        while(!stack1.empty()){
            stack2.push(stack1.top());
            stack1.pop();
        }
        int val = stack2.top();
        stack2.pop();
        while(!stack2.empty()){
            stack1.push(stack2.top());
            stack2.pop();
        }
        return val;
    }

private:
    stack<int> stack1;
    stack<int> stack2; // 辅助栈
};

8 跳台阶

class Solution {
public:
    int jumpFloor(int n) {
      // 跳台阶的动态规划
        vector<int> dp(n+1,0);
        dp[0] = 1;
        for(int i = 1; i <= n; ++i){
            for(int j = 1; j <=2; ++j){
                if(i - j >= 0) dp[i] += dp[i - j];
            }
        }
        return dp[n];
    }
};

9 求连续子数组的最大和

时间复杂度 O(n)

class Solution {
public:
    int FindGreatestSumOfSubArray(vector<int> array) {
        // 动态规划 dp[i] 表示添加i个数组后 最大和
        if(array.size() == 1) return array[0];
        int res = array[0];
        int n = array.size();
        vector<int> dp(n+1,0);
        dp[0] = array[0];
        for(int i = 1; i < array.size(); ++i){
            dp[i] = max(dp[i-1]+array[i], array[i]);
            res = max(res, dp[i]);
        }
        return res;
    }
};

优化空间复杂度

class Solution {
public:
    int FindGreatestSumOfSubArray(vector<int> array) {
        int sum = 0;
        int maxVal = array[0];
        for(int i = 0; i < array.size(); ++i){
            sum = max(sum + array[i], array[i]);
            maxVal = max(sum, maxVal);
        }
        return maxVal;
    }
};

10 判断一个链表是否有环

/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     ListNode *next;
 *     ListNode(int x) : val(x), next(NULL) {}
 * };
 */
class Solution {
public:
    bool hasCycle(ListNode *head) {
        // 特殊情况 当链表长度为空为1无环
        // 有环 必然会相遇
        // 无环 则必然会遇到空节点
        if(head == nullptr || head->next == nullptr){
            return false;
        }
        ListNode* fast = head->next;
        ListNode* slow = head;
        while(fast->next!=nullptr && fast->next->next!=nullptr){
            if(slow == fast){
                return true;
            }else{
                fast = fast->next->next;
                slow = slow->next;
            }
        }
        return false;
    }
};

11 删除链表倒数第K个节点(已经考了)

class Solution {
public:
    //求链表的长度
    int len(ListNode* head){
        int s=0;
        while(head!=NULL){
            s++;
            head=head->next;
        }
        return s;
    }
    ListNode* removeNthFromEnd(ListNode* head, int n) {
        ListNode* pre=head;
        int k=len(pre)-n;
        //要是之间是删除的是头节点 直接指针后移
        if(k==0){
            return head->next;
        }
        for(int i=0;i<k-1;i++){
            pre=pre->next;
        }
        //越过删除的结点
        pre->next=pre->next->next;
        return head;
    }
};

12 大小端

#include<iostream>
using namespace std;
int main(){
	union{
		int num;
		char lowC;
	}data;
	data.num = 1;
	if(data.lowC == 1){
		cout<<"small "<<endl;
	}else{
		cout<<"big "<<endl;
	}
	return 0;
} 

13 二叉树公共祖先

class Solution {
public:
    TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
        if (root == q || root == p || root == NULL) return root;
        TreeNode* left = lowestCommonAncestor(root->left, p, q);
        TreeNode* right = lowestCommonAncestor(root->right, p, q);
        if (left != NULL && right != NULL) return root;

        if (left == NULL && right != NULL) return right;
        else if (left != NULL && right == NULL) return left;
        else  { //  (left == NULL && right == NULL)
            return NULL;
        }

    }
};

14 二叉搜素树的公共祖先

解题思路: 公共祖先必然是再左右节点之间 [p,q]

class Solution {
public:
    TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
        if (root->val > p->val && root->val > q->val) {
            return lowestCommonAncestor(root->left, p, q);
        } else if (root->val < p->val && root->val < q->val) {
            return lowestCommonAncestor(root->right, p, q);
        } else return root;
    }
};
class Solution {
public:
    TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
        while(root) {
            if (root->val > p->val && root->val > q->val) {
                root = root->left;
            } else if (root->val < p->val && root->val < q->val) {
                root = root->right;
            } else return root;
        }
        return NULL;
    }
};

15 字符串出现次数的TopK问题

自定义小堆

struct cmp {
    bool operator() (pair<string, int> &p1, pair<string, int> &p2) {
        return p1.second > p2.second || (p1.second == p2.second && p1.first < p2.first); //出现次数较高或者出现次数相同字典序小的优先级高(堆顶的元素优先级最低)
    }
};
class Solution {
public:
    vector<vector<string> > topKstrings(vector<string>& strings, int k) {
        vector<vector<string> > res;
        unordered_map<string, int> umap; //用于统计字符串出现次数
        for(string &s: strings) umap[s]++; 
        priority_queue<pair<string, int>, vector<pair<string, int> >, cmp> pq; //自定义优先队列
        for(auto it = umap.begin(); it != umap.end(); it++) { //遍历无序map
            if(pq.size() < k) pq.emplace(pair<string, int> {it->first, it->second}); //当堆元素数小于k直接入堆
            else if(it->second > pq.top().second || (it->second == pq.top().second && it->first < pq.top().first)) { //否则判断是否能取出堆顶放入新元素
                pq.pop();
                pq.emplace(pair<string, int> {it->first, it->second});
            }
        }
        while(!pq.empty()) { //由优先级从小到大依次取出
            res.emplace_back(vector<string> {pq.top().first, to_string(pq.top().second)});
            pq.pop();
        }
        reverse(res.begin(), res.end()); //逆转使优先级从大到小
        return res; //返回结果
    }
};

16 加起来和位目标值的组合(二)

class Solution {
  public:
    void dfs(vector<int>& num, int target, vector<vector<int> >& res,
             vector<int>& tmp, int start) {
        if (target == 0) {
            res.push_back(tmp);
            return;
        }
        if (start >= num.size()) return;
        for (int i = start; i < num.size(); ++i) {
            if (i > start && num[i] == num[i - 1]) continue;
            // 剪枝
            //前面的排序就有意义了 这块要是剩余的num[i]的值已经大于target的大小 后面已经是无效搜索了
            if (num[i] <= target ) {
                tmp.push_back(num[i]);
                dfs(num, target - num[i], res, tmp,i + 1);
                tmp.pop_back();
            }
        }
    }

    vector<vector<int> > combinationSum2(vector<int>& num, int target) {
        vector<vector<int> > res;
        vector<int> tmp;
        if (num.empty()) return res;
        sort(num.begin(), num.end());
        dfs(num, target, res, tmp, 0);
        return res;
    }
};

17 连续子数组的最大乘积

class Solution {
public:
    /**
     * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
     * @param nums int整型vector
     * @return int整型
     */
    int maxProduct(vector<int>& nums) {
        vector<int> pos(nums); // 存储以nums[i] 结尾的最大乘积
        vector<int> neg(nums); // 存储以 nums[i] 结尾的最小乘积
        int result=nums[0];
        for(int i=1;i<nums.size();i++){
            pos[i]=max(nums[i],max(nums[i]*pos[i-1],nums[i]*neg[i-1]));
            neg[i]=min(nums[i],min(nums[i]*pos[i-1],nums[i]*neg[i-1]));
            result=max(result,pos[i]);
        }
        return result;
    }
};

18 设计一个循环数组

class MyCircularQueue {
private:
    int front;
    int tail;
    int capity;
    vector<int> element;
public:
    MyCircularQueue(int k) {
        this->capity = k + 1;
        front = tail = 0;
        this->element = vector<int>(capity);
    }
    
    bool enQueue(int value) {
        if(isFull()){
            return false;
        }
        element[tail] = value;
        tail = (tail + 1) % capity;
        return true;
    }
    
    bool deQueue() {
        if(isEmpty()){
            return false;
        }
        front = (front + 1) % capity;
        return true;
    }
    
    int Front() {
        if(isEmpty()){
            return -1;
        }
        return element[front];
    }
    
    int Rear() {
        if(isEmpty()){
            return -1;
        }
        return element[(tail -1 + capity) % capity];
    }
    
    bool isEmpty() {
        return front == tail;
    }
    
    bool isFull() {
        return front == (tail + 1) % capity;
    }
};

/**
 * Your MyCircularQueue object will be instantiated and called as such:
 * MyCircularQueue* obj = new MyCircularQueue(k);
 * bool param_1 = obj->enQueue(value);
 * bool param_2 = obj->deQueue();
 * int param_3 = obj->Front();
 * int param_4 = obj->Rear();
 * bool param_5 = obj->isEmpty();
 * bool param_6 = obj->isFull();
 */

最后 🐶狗头保命

一名喜欢书写博客的研究生在读生

如果觉得有用,麻烦三连支持一下欧,希望这篇文章可以帮到你,你的点赞是我持续更新的动力

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

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

相关文章

Docker(二) ----Docker 的基本操作

文章目录前言一、镜像操作1.1 镜像的组成1.2 镜像的操作二、容器操作2.1 容器的基本操作2.2 容器操作的小结总结前言 前面我们学习了Docker的基本定义以及如何安装 Docker, 接下来我们对Docker的基本操作进行了解。上篇文章可点击 初始Docker 一、镜像操作 1.1 镜像的组成 镜…

SpringBoot 整合 Groovy 脚本,实现动态编程

Groovy简介 Groovy 是增强 Java 平台的唯一的脚本语言。它提供了类似于 Java 的语法&#xff0c;内置映射&#xff08;Map&#xff09;、列表&#xff08;List&#xff09;、方法、类、闭包&#xff08;closure&#xff09;以及生成器。脚本语言不会替代系统编程语言&#xff…

在idea中离线安装scala

由于网络受限&#xff0c;需要离线安装和使用scala&#xff0c;安装步骤如下。 1 安装idea scala插件 首先在idea的Help-Aboout选项中&#xff0c;查看idea的版本。 这里可以看到我的版本是2022.3&#xff0c;因此我需要下载对应版本的scala插件&#xff08;Scala插件地址&a…

git使用说明

在Windows上使用Git&#xff0c;可以从Git官网直接下载安装程序&#xff0c;然后按默认选项安装即可。 安装完成后&#xff0c;在开始菜单里找到“Git”->“Git Bash”&#xff0c;蹦出一个类似命令行窗口的东西&#xff0c;就说明Git安装成功&#xff01; 安装完成后&…

MySQL重大Bug!自增主键竟然不是连续递增

InnoDB 自增值保存在内存&#xff0c;MySQL 8.0后&#xff0c;才有了“自增值持久化”能力&#xff0c;即才实现了“若重启&#xff0c;表的自增值可以恢复为MySQL重启前的值”&#xff0c;具体情况是&#xff1a; ≤5.7&#xff0c;自增值保存在内存&#xff0c;无持久化。每…

基于免疫算法的认知无线电资源分配优化算法的matlab仿真

目录 1.算法描述 2.仿真效果预览 3.MATLAB核心程序 4.完整MATLAB 1.算法描述 认知无线电&#xff08;CR&#xff09;的概念来自Joseph Mitolo博士1999年的开创性工作。它自适应地调整内部通信机制&#xff0c;通过学习&#xff0c;了解等实时变化特定的无线电操作参数&…

数据库实验四:触发器实验

实验四 触发器实验 1.实验目的 ​ 掌握数据库触发器的设计和使用方法。 2.实验内容和要求 ​ 定义BEFORE触发器和AFTER触发器&#xff0c;能够理解不同类型触发器的作用和执行原理&#xff0c;验证触发器的有效性。 3.实验重点和难点 ​ 实验重点&#xff1a;触发器的定义…

大二Web课程设计——张家界旅游网站设计与实现(HTML+CSS+JavaScript)

&#x1f468;‍&#x1f393;学生HTML静态网页基础水平制作&#x1f469;‍&#x1f393;&#xff0c;页面排版干净简洁。使用HTMLCSS页面布局设计,web大学生网页设计作业源码&#xff0c;这是一个不错的旅游网页制作&#xff0c;画面精明&#xff0c;排版整洁&#xff0c;内容…

【应用】Modbus 通讯协议

Modbus 通讯协议Modbus 协议基础Modbus 存储区Modbus-RTU 协议Modbus-TCP 协议Java 实现 Modbus 通讯Modbus ReadModbus Write模拟数据进行代码测试Modbus-RTU 代码验证Modbus-TCP 代码验证SerialPortWrapper 实现类代码Modbus 协议基础 Modbus 是一种总线通讯协议&#xff0c;…

[附源码]计算机毕业设计贵港高铁站志愿者服务平台Springboot程序

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

Spring Bean的生命周期

一、首先我们要知道什么是Spring Bean&#xff1a;Spring Bean是Spring框架在运行管理时的对象。 二、Spring Bean的生命周期&#xff1a; 简单来说bean会经历四个阶段&#xff1a; 实例化 -》 属性赋值 -》初始化 -》销毁 下面我们来具体看一下&#xff1a; 1.实例化 Bea…

软件质量评估模型

软件质量是指软件产品满足用户要求的程度。可以从多个方面来理解此处所指的用户要求,包括用户期望的软件系统的功能、性能、可维护性、可操作性、可重用性等等。在软件项目实施过程中,经常会听到用户关于软件系统的以下一组质量评价。 软件系统没有某些方面的功能软件系统运行…

【5G MAC】NR Timing Advance(RAR TA 和 MAC-CE TA)

博主未授权任何人或组织机构转载博主任何原创文章&#xff0c;感谢各位对原创的支持&#xff01; 博主链接 本人就职于国际知名终端厂商&#xff0c;负责modem芯片研发。 在5G早期负责终端数据业务层、核心网相关的开发工作&#xff0c;目前牵头6G算力网络技术标准研究。 博客…

[Linux]基础命令(1)

Linux基本命令&#xff08;1&#xff09; 文章目录Linux基本命令&#xff08;1&#xff09;1.操作系统&#xff1a;&#xff08;1&#xff09;什么是操作系统&#xff1a;&#xff08;2&#xff09;为什么要有操作系统&#xff1a;2. ls命令:3. pwd指令&#xff1a;4. cd命令:5…

2022-12-11

文章目录前言PWMPwmChannelPwmAssignedHwUnitPwmChannelIdPwmCoherentUpdatePwmDutycycleDefaultPwmIdleStatePwmNotificationPwmChannelClassPwmPeriodDefaultPwmPolarityPwmReferenceChannelPwmSafetySignalPwmShiftValuePWM输出偏移的使用PwmConfigurationOfOptApiServicesP…

windows 基于 MediaPipe 实现 Holistic

主页: https://google.github.io/mediapipe/solutions/holistic.html MediaPipe Holistic pipelines 集成了姿势、面部和手部组件的独立模型&#xff0c;每个组件都针对其特定领域进行了优化&#xff0c;每个组件的推断输入图不同。 MediaPipe Holistic 首先通过 BlazePose 的姿…

基于极限学习机进行股市预测(Matlab代码实现)

&#x1f468;‍&#x1f393;个人主页&#xff1a;研学社的博客 &#x1f4a5;&#x1f4a5;&#x1f49e;&#x1f49e;欢迎来到本博客❤️❤️&#x1f4a5;&#x1f4a5; &#x1f3c6;博主优势&#xff1a;&#x1f31e;&#x1f31e;&#x1f31e;博客内容尽量做到思维缜…

MySQL-InnoDB的事务隔离级别

MySQL 是一个服务器&#xff0f;客户端架构的软件&#xff0c;对于同一个服务器来说&#xff0c;可以有若干个客户端与之连接&#xff0c;每个客户端与服务器连接上之后&#xff0c;就可以称之为一个会话&#xff08; Session &#xff09;。我们可以同时在不同的会话里输入各种…

【图像处理】opencv | 图像的载入,显示,保存 | 视频流的载入,显示,保存

文章目录前言一、cv2读取图片并展示1.1、cv2.imread读取图片1.2、cv2.imshow展示图片1.3、完整代码1.4、封装函数调用1.5、cv2读取为灰度图像1.6、cv2.imwrite保存图像二、cv2读取视频并且展示2.1 展示彩色视频2.2 展示灰度视频2.3 保存视频前言 本文参考视频&#xff1a;唐宇…

二进制搭建k8s——部署etcd集群和单master

二进制搭建k8s——部署etcd集群和单master二进制搭建k8s——部署etcd集群和单master环境1、操作系统初始化配置&#xff08;全部节点&#xff09;2、部署 docker 引擎&#xff08;所有节点&#xff09;3、部署 etcd 集群准备签发证书环境在 master01 节点上操作在 node01 和 no…