python: Sorting Algorithms
# encoding: utf-8
# 版权所有 2023 涂聚文有限公司
# 许可信息查看:Python Sorting Algorithms
# 描述: * https://www.programiz.com/dsa/counting-sort
# * https://www.geeksforgeeks.org/sorting-algorithms/
# Author : geovindu,Geovin Du 涂聚文.
# IDE : PyCharm 2023.1 python 311
# Datetime : 2023/9/21 21:55
# User : geovindu
# Product : PyCharm
# Project : EssentialAlgorithms
# File : SortingAlgorithms.py
# explain : 学习import tkinter as tk
from tkinter import ttk
import itertools
import math
import sys
import os
from typing import Listclass SortingAlgorithms(object):"""排序算法"""def BubbleSort(array:list):"""1。Bubble Sort冒泡排序法:param array int数组:return:"""# loop to access each array elementfor i in range(len(array)):# loop to compare array elementsfor j in range(0, len(array) - i - 1):# compare two adjacent elements# change > to < to sort in descending orderif array[j] > array[j + 1]:# swapping elements if elements# are not in the intended ordertemp = array[j]array[j] = array[j + 1]array[j + 1] = tempdef BubbleSort2(array:list):"""1。Bubble Sort冒泡排序法:param array int数组:return:"""# loop through each element of arrayfor i in range(len(array)):# keep track of swappingswapped = False# loop to compare array elementsfor j in range(0, len(array) - i - 1):# compare two adjacent elements# change > to < to sort in descending orderif array[j] > array[j + 1]:# swapping occurs if elements# are not in the intended ordertemp = array[j]array[j] = array[j + 1]array[j + 1] = tempswapped = True# no swapping means the array is already sorted# so no need for further comparisonif not swapped:breakdef SelectionSort(array:list):"""2 python Program for Selection Sort 选择排序:param array int数组:return:"""for i in range(len(array)):# Find the minimum element in remaining# unsorted arraymin_idx = ifor j in range(i+1, len(array)):if array[min_idx] > array[j]:min_idx = j# Swap the found minimum element with# the first elementarray[i], array[min_idx] = array[min_idx], array[i]def InsertionSort(array:list):"""3 Insertion Sort插入排序:param array int数组:return:"""# Traverse through 1 to len(arr)for i in range(1, len(array)):key = array[i]# Move elements of arr[0..i-1], that are# greater than key, to one position ahead# of their current positionj = i - 1while j >= 0 and key < array[j]:array[j + 1] = array[j]j -= 1array[j + 1] = keydef Partition(array, low, high):""":param array int数组:param low::param high::return:"""# Choose the rightmost element as pivotpivot = array[high]# Pointer for greater elementi = low - 1# Traverse through all elements# compare each element with pivotfor j in range(low, high):if array[j] <= pivot:# If element smaller than pivot is found# swap it with the greater element pointed by ii = i + 1# Swapping element at i with element at j(array[i], array[j]) = (array[j], array[i])# Swap the pivot element with# the greater element specified by i(array[i + 1], array[high]) = (array[high], array[i + 1])# Return the position from where partition is donereturn i + 1def QuickSort(array, low, high):"""4 Quick Sort 快速排序:param array int数组:param low::param high::return:"""if low < high:# Find pivot element such that# element smaller than pivot are on the left# element greater than pivot are on the rightpi = SortingAlgorithms.Partition(array, low, high)# Recursive call on the left of pivotSortingAlgorithms.QuickSort(array, low, pi - 1)# Recursive call on the right of pivotSortingAlgorithms.QuickSort(array, pi + 1, high)def MergeSort(array:list):"""5 Merge Sort 合并/归并排序:param array int数组:return:"""if len(array) > 1:# Finding the mid of the arraymid = len(array) // 2# Dividing the array elementsL = array[:mid]# Into 2 halvesR = array[mid:]# Sorting the first halfSortingAlgorithms.MergeSort(L)# Sorting the second halfSortingAlgorithms.MergeSort(R)i = j = k = 0# Copy data to temp arrays L[] and R[]while i < len(L) and j < len(R):if L[i] <= R[j]:array[k] = L[i]i += 1else:array[k] = R[j]j += 1k += 1# Checking if any element was leftwhile i < len(L):array[k] = L[i]i += 1k += 1while j < len(R):array[k] = R[j]j += 1k += 1def CountingSort(array:list,hight:int):"""6 Counting Sort 计数排序:param array int数组:param hight 最大的整数 如100,数组中必须小数此数的整数:return:"""size = len(array)output = [0] * size# Initialize count arraydcount = [0] * hight# Store the count of each elements in count arrayprint(size)for i in range(0, size):dcount[array[i]] += 1# Store the cummulative count 最大的数for i in range(1, hight):dcount[i] += dcount[i - 1]# Find the index of each element of the original array in count array# place the elements in output arrayi = size - 1while i >= 0:output[dcount[array[i]] - 1] = array[i]dcount[array[i]] -= 1i -= 1# Copy the sorted elements into original arrayfor i in range(0, size):array[i] = output[i]def CountingSortTo(array: List[int]):"""6 Counting Sort 计数排序:param:return:"""max = min = 0for i in array:if i < min:min = iif i > max:max = icount = [0] * (max - min + 1)for j in range(max - min + 1):count[j] = 0for index in array:count[index - min] += 1index = 0for a in range(max - min + 1):for c in range(count[a]):array[index] = a + minindex += 1def countingSort(array, exp1):""":param array:param exp1::return:"""n = len(array)# The output array elements that will have sorted arroutput = [0] * (n)# initialize count array as 0count = [0] * (10)# Store count of occurrences in count[]for i in range(0, n):index = array[i] // exp1count[index % 10] += 1# Change count[i] so that count[i] now contains actual# position of this digit in output arrayfor i in range(1, 10):count[i] += count[i - 1]# Build the output arrayi = n - 1while i >= 0:index = array[i] // exp1output[count[index % 10] - 1] = array[i]count[index % 10] -= 1i -= 1# Copying the output array to arr[],# so that arr now contains sorted numbersi = 0for i in range(0, len(array)):array[i] = output[i]def RadixSort(array:list):"""7 Radix Sort 基数排序:param array:return:"""# Find the maximum number to know number of digitsmax1 = max(array)# Do counting sort for every digit. Note that instead# of passing digit number, exp is passed. exp is 10^i# where i is current digit numberexp = 1while max1 / exp >= 1:SortingAlgorithms.countingSort(array, exp)exp *= 10def insertionSort(array:list):""":return:"""for i in range(1, len(array)):up = array[i]j = i - 1while j >= 0 and array[j] > up:array[j + 1] = array[j]j -= 1array[j + 1] = upreturn arraydef BucketSort(array):"""8 Bucket Sort 桶排序:param array:return:"""arr = []slot_num = 10 # 10 means 10 slots, each# slot's size is 0.1for i in range(slot_num):arr.append([])# Put array elements in different bucketsfor j in array:index_b = int(slot_num * j)arr[index_b].append(j)# Sort individual bucketsfor i in range(slot_num):arr[i] = SortingAlgorithms.insertionSort(arr[i])# concatenate the resultk = 0for i in range(slot_num):for j in range(len(arr[i])):array[k] = arr[i][j]k += 1return array# Bucket Sort in Pythondef BucketSortTo(array:list):"""8 Bucket Sort 桶排序:param array:return:"""bucket = []# Create empty bucketsfor i in range(len(array)):bucket.append([])# Insert elements into their respective bucketsfor j in array:index_b = int(10 * j)bucket[index_b].append(j)# Sort the elements of each bucketfor i in range(len(array)):bucket[i] = sorted(bucket[i])# Get the sorted elementsk = 0for i in range(len(array)):for j in range(len(bucket[i])):array[k] = bucket[i][j]k += 1return arraydef heapify(array:list, Nsize:int, index:int):""":param array 数组:param Nsize: 数组长度:param index: 索引号:return:"""largest = index # Initialize largest as rootl = 2 * index + 1 # left = 2*i + 1r = 2 * index + 2 # right = 2*i + 2# See if left child of root exists and is# greater than rootif l < Nsize and array[largest] < array[l]:largest = l# See if right child of root exists and is# greater than rootif r < Nsize and array[largest] < array[r]:largest = r# Change root, if neededif largest != index:array[index], array[largest] = array[largest], array[index] # swap# Heapify the root.SortingAlgorithms.heapify(array, Nsize, largest)# The main function to sort an array of given sizedef HeapSort(array:list):"""9 Heap Sort 堆排序:param array:return:"""Nsize = len(array)# Build a maxheap.for i in range(Nsize // 2 - 1, -1, -1):SortingAlgorithms.heapify(array, Nsize, i)# One by one extract elementsfor i in range(Nsize - 1, 0, -1):array[i], array[0] = array[0], array[i] # swapSortingAlgorithms.heapify(array, i, 0)def ShellSort(array:list):"""10 Shell Sort 希尔排序:param array 数组:return:"""# code herenszie=len(array)gap = nszie // 2while gap > 0:j = gap# Check the array in from left to right# Till the last possible index of jwhile j < nszie:i = j - gap # This will keep help in maintain gap valuewhile i >= 0:# If value on right side is already greater than left side value# We don't do swap else we swapif array[i + gap] > array[i]:breakelse:array[i + gap], array[i] = array[i], array[i + gap]i = i - gap # To check left side also# If the element present is greater than current elementj += 1gap = gap // 2def LinearSearch(array:list,fint:int):"""11 Linear Search线性搜索:param array 整数数组:param fint 要查找的数字:return:"""nsize=len(array)# Going through array sequenciallyfor i in range(0, nsize):if (array[i] == fint):return i #找到了return -1 #未找到def BinarySearch(array:list, x, low, high):"""12 Binary Search 二分查找:param x::param low::param high::return:"""if high >= low:mid = low + (high - low) // 2# If found at mid, then return itif array[mid] == x:return mid# Search the left halfelif array[mid] > x:return SortingAlgorithms.BinarySearch(array, x, low, mid - 1)# Search the right halfelse:return SortingAlgorithms.BinarySearch(array, x, mid + 1, high)else:return -1def BingoSort(array, size):""":param array:param size::return:"""# Finding the smallest element From the Arraybingo = min(array)# Finding the largest element from the Arraylargest = max(array)nextBingo = largestnextPos = 0while bingo < nextBingo:# Will keep the track of the element position to# shifted to their correct positionstartPos = nextPosfor i in range(startPos, size):if array[i] == bingo:array[i], array[nextPos] = array[nextPos], array[i]nextPos += 1# Here we are finding the next Bingo Element# for the next passelif array[i] < nextBingo:nextBingo = array[i]bingo = nextBingonextBingo = largest
# encoding: utf-8
# 版权所有 2023 涂聚文有限公司
# 许可信息查看:
# 描述:
# Author : geovindu,Geovin Du 涂聚文.
# IDE : PyCharm 2023.1 python 311
# Datetime : 2023/9/21 22:00
# User : geovindu
# Product : PyCharm
# Project : EssentialAlgorithms
# File : SortingExample.py
# explain : 学习import ChapterOne.SortingAlgorithmsclass Example(object):""""实例"""def Bubble(self):"""1。Bubble Sort冒泡排序法:return:"""data = [-2, 45, 0, 11, -9]ChapterOne.SortingAlgorithms.SortingAlgorithms.BubbleSort(data)print('\n1 冒泡排序法 Bubble Sorted Array in Ascending Order:')for i in range(len(data)):print("%d" % data[i], end=" ")def Select(self):"""2 Selection Sort 选择排序:return:"""geovindu = [64, 25, 12, 22, 11]ChapterOne.SortingAlgorithms.SortingAlgorithms.SelectionSort(geovindu)print("\n2 选择排序Selection Sorted ")for i in range(len(geovindu)):print("%d" % geovindu[i], end=" ")def Insert(self):"""3 Insertion Sort插入排序:return:"""arr = [12, 11, 13, 5, 6]ChapterOne.SortingAlgorithms.SortingAlgorithms.InsertionSort(arr)print("\n3 插入排序 Insertion Sorted ")for i in range(len(arr)):print("% d" % arr[i], end=" ")def Quick(self):"""4 Quick Sort 快速排序:return:"""array = [10, 7, 8, 9, 1, 5]N = len(array)# Function callChapterOne.SortingAlgorithms.SortingAlgorithms.QuickSort(array, 0, N - 1)print("\n4 快速排序 Quick Sorted ")for x in array:print(x, end=" ")def Merge(self):"""5 Merge Sort 合并/归并排序:return:"""geovindu = [12, 11, 99, 13, 5, 6, 7,88,100]ChapterOne.SortingAlgorithms.SortingAlgorithms.MergeSort(geovindu)print("\n5 合并/归并排序 Merge Sorted ")for x in geovindu:print(x, end=" ")def Counting(self):"""6 Counting Sort 计数排序:return:"""geovindu = [17, 56, 71, 38, 61, 62, 48, 28, 57, 42]ChapterOne.SortingAlgorithms.SortingAlgorithms.CountingSortTo(geovindu)print("\n6 计数排序 Counting Sorted ")print(geovindu)for i in range(0,len(geovindu)):print("% d" % geovindu[i], end=" ")geovindu = [4, 55, 22, 98, 9, 43, 11]ChapterOne.SortingAlgorithms.SortingAlgorithms.CountingSort(geovindu, 100)print("\n6 计数排序 Counting Sorted ")for x in geovindu:print(x, end=" ")def Radix(self):"""7 Radix Sort 基数排序:return:"""geovindu = [170, 45, 75, 90, 802, 24, 2, 66]print("\n7 基数排序 Radix Sorted ")# Function CallChapterOne.SortingAlgorithms.SortingAlgorithms.RadixSort(geovindu)for i in range(len(geovindu)):print(geovindu[i], end=" ")def Bucket(self):"""8 Bucket Sort 桶排序:return:"""#geovindu = [170, 45, 75, 90, 802, 24, 2, 66]geovindu = [0.897, 0.565, 0.656,0.1234, 0.665, 0.3434]print("\n8 桶排序 Bucket Sorted ")# Function Calldu=ChapterOne.SortingAlgorithms.SortingAlgorithms.BucketSort(geovindu)for i in range(len(du)):print(du[i], end=" ")def Heap(self):"""9 Heap Sort 堆排序:return:"""geovindu = [170, 45, 75, 90, 802, 24, 2, 66]print("\n9 堆排序 Heap Sorted ")# Function CallChapterOne.SortingAlgorithms.SortingAlgorithms.HeapSort(geovindu)for i in range(len(geovindu)):print(geovindu[i], end=" ")def Shell(self):"""10 Shell Sort 希尔排序:return:"""geovindu = [170, 45, 75, 90, 802, 24, 2, 66]print("\n10 希尔排序 Shell Sorted ")# Function CallChapterOne.SortingAlgorithms.SortingAlgorithms.ShellSort(geovindu)for i in range(len(geovindu)):print(geovindu[i], end=" ")def Linear(self):"""11 Linear Search 线性搜索:return:"""array = [2, 4, 8,0, 1, 9]x = 8n = len(array)result = ChapterOne.SortingAlgorithms.SortingAlgorithms.LinearSearch(array,x)print("\n11 线性搜索 Linear Search ")if (result == -1):print("Element not found")else:print("Element found at index: ", result)def Binary(self):"""12 Binary Search 二分查找:return:"""array = [3, 4, 5, 6, 7, 8, 9]x = 4result = ChapterOne.SortingAlgorithms.SortingAlgorithms.BinarySearch(array, x, 0, len(array) - 1)print("\n12 二分查找 Binary Search ")if result != -1:print("Element is present at index " + str(result))else:print("Not found")def Bingo(self):"""13 Bingo Sort:return:"""arr = [5, 4, 8, 5, 4, 8, 5, 4, 4, 4]ChapterOne.SortingAlgorithms.SortingAlgorithms.BingoSort(arr, size=len(arr))print("\n13 Bingo Sorted ")for i in range(len(arr)):print(arr[i], end=" ")
调用:
exm=BLL.SortingExample.Example()exm.Bubble()exm.Select()exm.Insert()exm.Quick()exm.Merge()exm.Counting()exm.Radix()exm.Bucket()exm.Heap()exm.Shell()exm.Linear()exm.Binary()exm.Bingo()
相关文章:
![](https://www.ngui.cc/images/no-images.jpg)
python: Sorting Algorithms
# encoding: utf-8 # 版权所有 2023 涂聚文有限公司 # 许可信息查看:Python Sorting Algorithms # 描述: * https://www.programiz.com/dsa/counting-sort # * https://www.geeksforgeeks.org/sorting-algorithms/ # Author : geovindu,Geovin Du 涂…...
![](https://www.ngui.cc/images/no-images.jpg)
Python 安装js环境
在终端执行下面的命令 npm install jsdom jsdom 是一个实现了 DOM API 的 JavaScript 环境,用于在 Node.js 中模拟浏览器的 DOM 环境。execjs 使用 jsdom 这个模块来执行 JavaScript 代码。所以在你的系统中,需要先安装并配置好 jsdom 模块,…...
![](https://img-blog.csdnimg.cn/img_convert/5416073cb7ced283379fbc1fa48373c4.png)
2023华为杯数模C题——大规模创新类竞赛评审方案研究
B题——大规模创新类竞赛评审方案研究 思路:采用数据分析等手段改进评分算法性能 完成情况(1-2问已经完成) 代码下载 问题一 在每个评审阶段,作品通常都是随机分发的,每份作品需要多位评委独立评审。为了增加不同评审专家所给成绩之间的可比…...
人工神经网络ANN:数学总结
一、内容 径向基函数(Radial basis function,RBF):一个取值仅依赖于到原点距离的实值函数,即。此外,也可以按到某一中心点c的距离来定义,即。 可以用于许多向函基数的和来逼近某一给定的函数&a…...
![](https://img-blog.csdnimg.cn/7f8fe4dfa513446185349c651d494669.png)
RabbitMQ的工作模式——WorkQueues
1.工作队列模式 生产者代码 public class Producer_WorkQueues1 {public static void main(String[] args) throws IOException, TimeoutException {//1.创建连接工厂ConnectionFactory factory new ConnectionFactory();//2.设置参数factory.setHost("172.16.98.133&qu…...
![](https://www.ngui.cc/images/no-images.jpg)
AOJ 0531 坐标离散化
一、题目大意 在(0<x<w,0<y<h)的坐标系里有多个矩形,把区域分成了多个部分,我们需要针对找出被矩形分割的连通的区块数量。 二、解题思路 这个题目其实和学DFS时候那个找出连通的水洼是一样的。只是这个地图比较大,…...
![](https://img-blog.csdnimg.cn/0767976a5dfe460280c35be5a1623470.png)
Python —— pytest框架
1、认识pytest框架 1、搭建自动化框架的思路与流程 1、搭建自动化测试框架的思路和流程,任意测试手段流程都是一致的:手工测试、自动化测试、工具测试 手工测试:熟悉业务 —— 写用例 —— 执行用例并记录结果 —— 生成测试报告自动化测试…...
![](https://img-blog.csdnimg.cn/321c187d17fc46c2af39c041d1e14066.jpeg)
IP地址欺骗的危害与后果
IP地址欺骗,也被称为IP地址伪装或IP地址欺诈,是一种网络攻击技术,旨在伪装或隐藏攻击者的真实IP地址。尽管这种技术可能有一些合法的用途,例如保护用户的隐私或绕过地理位置限制,但它也经常被恶意黑客用于不法行为。本…...
![](https://img-blog.csdnimg.cn/f68d517149054be18b075ba2dc4af025.png#pic_center)
系统集成|第十章(笔记)
目录 第十章 质量管理10.1 项目质量管理概论10.2 主要过程10.2.1 规划质量管理10.2.2 实施质量保证10.2.3 质量控制 10.3 常见问题 上篇:第九章、成本管理 第十章 质量管理 10.1 项目质量管理概论 质量管理:指确定质量方针,质量目标和职责&a…...
![](https://www.ngui.cc/images/no-images.jpg)
Linux之perf(7)配置
Linux之perf(7)配置类命令 Author:Onceday Date:2023年9月23日 漫漫长路,才刚刚开始… 注:该文档内容采用了GPT4.0生成的回答,部分文本准确率可能存在问题。 参考文档: Tutorial - Perf Wiki (kernel.org)perf(1)…...
![](https://img-blog.csdnimg.cn/b64b1c48e023404fbc8503e9c1b62121.gif)
14:00面试,14:06就出来了,问的问题过于变态了。。。
从小厂出来,没想到在另一家公司又寄了。 到这家公司开始上班,加班是每天必不可少的,看在钱给的比较多的份上,就不太计较了。没想到5月一纸通知,所有人不准加班,加班费不仅没有了,薪资还要降40%…...
![](https://img-blog.csdnimg.cn/03d25e9a407147fb8b4ee2a4a857e3e9.png)
JPA的注解@Field指定为Keyword失败,导致查询不到数据
一、背景 使用 jpa 对es操作,查询条件不生效,需求是批量查询课程编号。说白了,就是一个In集合的查询。在es里,如果是精准匹配是termQuery,比如: queryBuilder.filter(QueryBuilders.termQuery(“schoolId…...
![](https://img-blog.csdnimg.cn/img_convert/f919a76683b375993482a0fcf9c8c095.png)
多线程带来的的风险-线程安全
多线程带来的的风险-线程安全 ~~ 多线程编程中,最难的地方,也是一个最重要的地方,还是一个最容易出错的地方,更是一个面试中特别爱考的地方.❤️❤️❤️ 线程安全的概念 万恶之源,罪魁祸首是多线程的抢占式执行,带来的随机性.~~😕😕&…...
![](https://www.ngui.cc/images/no-images.jpg)
Kafka 面试题
Kafka 面试题 Q:讲一下Kafka。 Kafka 入门一篇文章就够了 Kafka的简单理解 Q:消息队列,有哪些使用场景及用途? 解耦,削峰,限流。 Q:Kafka相对其他消息队列,有什么特点? 持久化:Kafka的持久化…...
![](https://img-blog.csdnimg.cn/a98d457f69264d3a9b6b648c9f744bb3.png)
离线部署 python 3.x 版本
文章目录 离线部署 python 3.x 版本1. 下载版本2. 上传到服务器3. 解压并安装4. 新建软连信息5. 注意事项 离线部署 python 3.x 版本 1. 下载版本 python 各版本下载地址 本次使用版本 Python-3.7.0a2.tgz # linux 可使用 wget 下载之后上传到所需服务器 wget https://www.py…...
![](https://www.ngui.cc/images/no-images.jpg)
Java 获取豆瓣电影TOP250
对于爬虫,Java并不是最擅长的,但是也可以实现,此次主要用到的包有hutool和jsoup。 hutool是一个Java工具包,它简化了Java的各种API操作,包括文件操作、类型转换、HTTP、日期处理、JSON处理、加密解密等。它的目标是使…...
![](https://www.ngui.cc/images/no-images.jpg)
笔试面试相关记录(5)
(1)不包含重复字符的最长子串的长度 #include <iostream> #include <string> #include <map>using namespace std;int getMaxLength(string& s) {int len s.size();map<char, int> mp;int max_len 0;int left 0;int i …...
![](https://img-blog.csdnimg.cn/dd9496cd814944da973e685e3fa3a098.png)
四、C#—变量,表达式,运算符(2)
🌻🌻 目录 一、表达式1.1 什么是表达式1.2 表达式的基本组成 二、运算符2.1 算术运算符2.1.1 使用 / 运算符时的注意事项2.1.2 使用%运算符时的注意事项 2.2 赋值运算符2.2.1 简单赋值运算符2.2.2 复合赋值运算符 2.3 关系运算符2.4 逻辑运算符2.4.1 逻辑…...
![](https://img-blog.csdnimg.cn/fc505aa2036649b480e0f2fb29ab20dc.png)
【WSN】基于蚁群算法的WSN路由协议(最短路径)消耗节点能量研究(Matlab代码实现)
💥💥💞💞欢迎来到本博客❤️❤️💥💥 🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。 ⛳️座右铭&a…...
![](https://img-blog.csdnimg.cn/d033addc6d5141caa0c29fd27fcd9e7b.png)
JVM的内存分配及垃圾回收
内存分配 在了解Java的内存管理前,需要知道JVM中的内存分配。 栈 存储局部变量。在方法的定义中或在方法中声明的变量为局部变量;栈内存中的数据在该方法结束(返回或抛出异常或方法体运行到最后)时自动释放栈中存放的数据结构为…...
![](https://img-blog.csdnimg.cn/be07141ff27846fdbf95f511415f25c2.png)
Python实现查询一个文件中的pdf文件中的关键字
要求,查询一个文件中的pdf文件中的关键字,输出关键字所在PDF文件的文件名及对应的页数。 import os import PyPDF2def search_pdf_files(folder_path, keywords):# 初始化结果字典,以关键字为键,值为包含关键字的页面和文件名列表…...
![](https://img-blog.csdnimg.cn/5cc7ca0c73484e46996a33644b633746.png)
【计算机网络笔记一】网络体系结构
IP和路由器概念 两台主机如何通信呢? 首先,主机的每个网卡都有一个全球唯一地址,MAC 地址,如 00:10:5A:70:33:61 查看 MAC 地址: windows: ipconfig / alllinux:ifconfig 或者 ip addr 同一个网络的多…...
![](https://img-blog.csdnimg.cn/3f22505a843e4dad8f8dd442f28132e3.png)
硕士应聘大专老师
招聘信息 当地人社局、学校(官方) 公众号(推荐): 辅导员招聘 厦门人才就业信息平台 高校人才网V 公告出完没多久就要考试面试,提前联系当地院校,问是否招人。 校招南方某些学校会直接去招老师。…...
![](https://www.ngui.cc/images/no-images.jpg)
Gram矩阵
Gram矩阵如何计算 Gram 矩阵是由一组向量的内积构成的矩阵。如果你有一组向量 v 1 , v 2 , … , v n v_1, v_2, \ldots, v_n v1,v2,…,vn,Gram 矩阵 G G G 的元素 G i j G_{ij} Gij 就是向量 v i v_i vi 和向量 v j v_j vj 的内积。数学上&#x…...
![](https://img-blog.csdnimg.cn/969d0f7e690f4925a1991ab574023921.png)
【数据结构】七大排序算法详解
目录 ♫什么是排序 ♪排序的概念 ♪排序的稳定性 ♪排序的分类 ♪常见的排序算法 ♫直接插入排序 ♪基本思想 ♪算法实现 ♪算法稳定性 ♪时间复杂度 ♪空间复杂度 ♫希尔排序 ♪基本思想 ♪算法实现 ♪算法稳定性 ♪时间复杂度 ♪空间复杂度 ♫直接选择排序 ♪基本思想 ♪算法…...
![](https://www.ngui.cc/images/no-images.jpg)
OpenCV之VideoCapture
VideoCaptrue类对视频进行读取操作以及调用摄像头。 头文件: #include <opencv2/video.hpp> 主要函数如下: 构造函数 C: VideoCapture::VideoCapture(); C: VideoCapture::VideoCapture(const string& filename); C: VideoCapture::Video…...
![](https://www.ngui.cc/images/no-images.jpg)
ESP32微控制器与open62541库: 详细指南实现OPC UA通信协议_C语言实例
1. 引言 在现代工业自动化和物联网应用中,通信协议起着至关重要的作用。OPC UA(开放平台通信统一架构)是一个开放的、跨平台的通信协议,被广泛应用于工业4.0和物联网项目中。本文将详细介绍如何在ESP32微控制器上使用C语言和open…...
![](https://img-blog.csdnimg.cn/b1849c22fa1e454eb3f60a9ff31777ed.png)
怎样快速打开github.com
访问这个网站很慢是因为有DNS污染,被一些别有用心的人搞了鬼了, 可以使用火狐浏览器开启火狐浏览器的远程dns解析就可以了.我试了一下好像单独这个办法不一定有用,要结合修改hosts文件方法,双重保障 好像就可以了...
![](https://img-blog.csdnimg.cn/6d970f53dae9464399ce0fe79c5ff3d6.png)
【C#】.Net基础语法二
目录 一、字符串(String) 【1.1】字符串创建和使用 【1.2】字符串其他方法 【1.3】字符串格式化的扩展方法 【1.4】字符串空值和空对象比较 【1.5】字符串中的转移字符 【1.6】大写的String和小写的string 【1.7】StringBuilder类的重要性 二、数组(Array) 【2.1】声…...
![](https://img-blog.csdnimg.cn/20190106163945739.jpg#pic_center)
C++之this指针总结(二百二十)
简介: CSDN博客专家,专注Android/Linux系统,分享多mic语音方案、音视频、编解码等技术,与大家一起成长! 优质专栏:Audio工程师进阶系列【原创干货持续更新中……】🚀 人生格言: 人生…...
![](/images/no-images.jpg)
浙江建筑协会网站/腾讯企点注册
既然这块知识点不清楚,那回头就自己动手实践下。 首先,创建一个最简单的表,只包含一个自增id,并插入一条数据。 create table t0(id int unsigned auto_increment primary key) ; insert into t0 values(null);通过show命令 sho…...
![](https://img2018.cnblogs.com/blog/354272/201812/354272-20181212183310153-1406276603.jpg)
泰州整站优化/今日热榜
引言 Bleve是Golang实现的一个全文检索库,类似Lucene之于Java。在这里通过阅读其代码,来学习如何使用及定制检索功能。也是为了通过阅读代码,学习在具体环境下Golang的一些使用方式。代码的路径在github上https://github.com/blevesearch/ble…...
![](https://img-blog.csdnimg.cn/801ec7c4399448e6b75f5515a80402d3.png)
企业门户网站 php/百度seo优化服务项目
一、前言 写这篇文章,是因为之前服务器有遇到过关于ssh服务的问题,sshd服务不稳定,出现断联等情况。影响日常操作。 今天就对该服务进行下总结 具体sshd服务的相关信息,可参考我之前文章: https://blog.csdn.net/xu71…...
![](/images/no-images.jpg)
中国做网站的公司/关键词搜索优化公司
Android开发过程中,对TextView会用得非常多,字体颜色渐变或增加很多色彩. 这里说三种渐变方式: 一、LinearGradient 1)继承 TextView,重写 onLayout 方法后设置 Shader,也可再ondraw中处理 public class GradientTe…...
![](/images/no-images.jpg)
哪个网站做漂流瓶任务/个人网站设计方案
3dsmax是一款很重要的3d场景绘制软件,可以做3d游戏,3d场景建模,3d动画等,但是软件比较大,安装也比较难,这就直接导致很多人心有余而力不足,想学,却找不到抓手,所以&#…...
![](/images/no-images.jpg)
手机网站建设万网/电商网站入口
java 生成4位随机数 验证码刘振兴代码分享2015年11月16日8166暂无评论public static String yzm(){String str "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z";String str2[] str.split(",");//将字符串以,分割Random rand…...