20240319-图论

news/2024/5/9 9:59:34/文章来源:https://blog.csdn.net/F13122298/article/details/136822557

图论练习题目

      • 拓扑排序
        • 深度优先搜索方法
        • 广度优先搜索方法
      • 无向无权图
      • 无向有权图
      • 有向无权图 利用广度优先搜索算法
      • 有向有权图 带排序的广度优先算法/dijkstra
      • 最小生成树
        • prims算法
        • Kruskal's Algorithm
      • 最小割 min-cut
      • 二分图 Bipartite Graph 队列
      • 例题1 所有可能的路径
      • 例题2 岛屿数量
      • 例题3 岛屿最大面积
      • 例题4 飞地的数量
      • 例题5 被围绕的区域
      • 例题6 太平洋大西洋水流问题
      • 例题7 钥匙和房间
      • 例题8 寻找图中是否存在路径
      • 例题9 冗余连接
      • 例题10 课程表 拓扑排序
      • 例题11 单词接龙
      • 例题12 最小高度树
      • 例题13 省份数量
      • 例题14 判断二分图

dfs采用的是栈,bfs采用的是队列。
sorted(L.items(),key=lambda x:(x[0],x[1],x[2],x[3]))

拓扑排序

在这里插入图片描述

深度优先搜索方法
import collections
graph = {'A':['F','E','C'],'B':['A','C'],'C':[],'D':['F'],'E':[],'F':['E','G'],'G':['F']
}
n=len(graph)
visted={key:0 for key in graph.keys()}
ans=[]
def dfs(u):if visted[u]==2:returnvisted[u]=1for v in graph[u]:if visted[v]==0:dfs(v)visted[u]=2ans.append(u)
for key in graph.keys():dfs(key)
print(ans)
# ['E', 'G', 'F', 'C', 'A', 'B', 'D']
广度优先搜索方法
import collections
graph = {'A':['F','E','C'],'B':['A','C'],'C':[],'D':['F'],'E':[],'F':['E','G'],'G':['F']
}
n=len(graph)
visted={key:0 for key in graph.keys()}
queue=[]
ans=[]
def bfs(u):if visted[u]:returnqueue.append(u)visted[u]=1while queue:node=queue.pop(0)ans.append(node)for v in graph[node]:if visted[v]==0:visted[v]=1queue.append(v)for key in graph.keys():bfs(key)
# bfs('A')
# print(ans,visted)
# bfs('B')
# print(ans,visted)
# ['E', 'G', 'F', 'C', 'A', 'B', 'D']
print(ans)
# ['A', 'F', 'E', 'C', 'G', 'B', 'D']

无向无权图

graph={1:[2,5],2:[1,3,4],3:[2],4:[2],5:[1,6],6:[5,7],7:[6]
}
n=len(graph)+1
# visted=[0]*n
visted=[0, 0, 0, 0, 0, 0, 0,0]
def dfs(u):ans=1visted[u]=1for v in graph[u]:if visted[v]==0:vh=dfs(v)
#             print(u,v,vh)ans=max(ans,vh+1)return ansdfs(2) #5

无向有权图

有向无权图 利用广度优先搜索算法

在这里插入图片描述在这里插入图片描述

graph={1:[2,4],2:[4,5],3:[1,6],4:[3,5,6,7],5:[7],6:[],7:[6],
}
def shortest(root,graph):n=len(graph)+1path=[0]*nvisit=[0]*ndist=[float('inf')]*nqueue=[root]visit[root]=1dist[root]=0while queue:ver=queue.pop()for nex in graph[ver]:if visit[nex]==0:path[nex]=vervisit[nex]=1dist[nex]=dist[ver]+1queue.append(nex)print(dist,path,visit)shortest(3,graph)

有向有权图 带排序的广度优先算法/dijkstra

在这里插入图片描述在这里插入图片描述

import heapq
graph1={1:[(2,2),(1,4)],2:[(3,4),(10,5)],3:[(4,1),(5,6)],4:[(2,3),(2,5),(8,6),(4,7)],5:[(1,7)],6:[],7:[(1,6)],
}
def shortest2(root,graph):n=len(graph)+1path=[0]*nvisit=[0]*ndist=[float('inf')]*ndist[root]=0queue=[(0,root)]heapq.heapify(queue)while queue:dis,ver=heapq.heappop(queue)visit[ver]=1for nex in graph[ver]:if visit[nex[1]]==0:heapq.heappush(queue,nex)if dist[ver]+nex[0]<dist[nex[1]]:dist[nex[1]]=dist[ver]+nex[0]path[nex[1]]=verprint(dist,path,visit)shortest2(3,graph1)
#[inf, 4, 6, 0, 5, 7, 5, 8] [0, 3, 1, 0, 1, 4, 3, 5] [0, 1, 1, 1, 1, 1, 1, 1]

最小生成树

prims算法

树是连通 无向 无环图。n个结点一定有n-1条边。
一个普通的生成树
在这里插入图片描述
最小生成树
在这里插入图片描述

Kruskal’s Algorithm

在这里插入图片描述在这里插入图片描述

graph=[[3,1,4],[3,4,2],[3,6,5],[1,4,1],[4,6,8],[1,2,2],[6,7,1],[2,4,3],[4,7,4],[2,5,10],[5,7,6],[4,5,7]
]
def kruskal(graph,n):find=[i for i in range(n+1)]graph.sort(key=lambda x:x[2])def parent(x):if find[x]==x:return xelse:return find[x]ans=[]while len(ans)<n-1:x,y,w = graph.pop(0)if parent(x)!=parent(y):ans.append([x,y,w])find[x]=yreturn anskruskal(graph,7)    
# [[1, 4, 1], [6, 7, 1], [3, 4, 2], [1, 2, 2], [2, 4, 3], [3, 1, 4]]

最小割 min-cut

二分图 Bipartite Graph 队列

例题1 所有可能的路径

https://leetcode.cn/problems/all-paths-from-source-to-target/description/

class Solution:def allPathsSourceTarget(self, graph: List[List[int]]) -> List[List[int]]:path = [0]ans=[]def dfs(graph,index):if index==len(graph)-1:ans.append(path[:])return for node in graph[index]:path.append(node)dfs(graph,node)path.pop()dfs(graph,0)return ans
class Solution:def allPathsSourceTarget(self, graph: List[List[int]]) -> List[List[int]]:from collections import dequeans=[]q=deque([[0],])while q:path = q.popleft()if path[-1]==len(graph)-1:ans.append(path)continuefor v in graph[path[-1]]:q.append(path+[v])return ans 

例题2 岛屿数量

https://leetcode.cn/problems/number-of-islands/description/

class Solution:def numIslands(self, grid: List[List[str]]) -> int:n=len(grid)m=len(grid[0])ans=0def wipe(x,y):dir=[lambda x,y:[x+1,y],#下lambda x,y:[x-1,y],#上lambda x,y:[x,y+1],#右lambda x,y:[x,y-1],#左]stack=[(x,y)]while stack:x,y=stack.pop()grid[x][y]='0'for i in range(4):nxt_x,nxt_y=dir[i](x,y)if nxt_x>=0 and nxt_x <n and nxt_y<m and nxt_y>=0:if grid[nxt_x][nxt_y]=='1':stack.append((nxt_x,nxt_y))for i in range(n):for j in range(m):if grid[i][j]=='1':ans+=1wipe(i,j)return ans

例题3 岛屿最大面积

https://leetcode.cn/problems/max-area-of-island/

class Solution:def maxAreaOfIsland(self, grid: List[List[int]]) -> int:n=len(grid)m=len(grid[0])ans=0for i in range(n):for j in range(m):if grid[i][j]==1:grid[i][j]=0tmp=1stack=[(i,j)]dir=[lambda x,y:[x+1,y],lambda x,y:[x-1,y],lambda x,y:[x,y+1],lambda x,y:[x,y-1],]while stack:x,y=stack.pop()grid[x][y]=0for k in range(4):nx,ny = dir[k](x,y)if nx>=0 and nx<n and ny>=0 and ny<m and grid[nx][ny]==1:tmp+=1grid[nx][ny]=0stack.append((nx,ny))ans = max(ans,tmp)return ans

例题4 飞地的数量

https://leetcode.cn/problems/number-of-enclaves/

class Solution:def numEnclaves(self, grid: List[List[int]]) -> int:n=len(grid)m=len(grid[0])ans=0def dfs(x,y):for dx,dy in (0,1),(1,0),(-1,0),(0,-1):nx = x+dxny =y+dyif 0<= nx <n and 0<= ny <m and grid[nx][ny]==1:grid[nx][ny]=0dfs(nx,ny)for i in [0,n-1] :for j in range(m):if grid[i][j]==1:ans+=1grid[i][j]=0dfs(i,j)for i in range(n):for j in [0,m-1]:if grid[i][j]==1:ans+=1grid[i][j]=0dfs(i,j)return sum(sum(g) for g in grid)
class Solution {public static int[][] dirs={{-1,0},{1,0},{0,1},{0,-1}};private int n,m;private boolean[][] visted;public int numEnclaves(int[][] grid) {n = grid.length;m=grid[0].length;visted = new boolean[n][m];for(int i=0;i<n;i++){dfs(grid,i,0);dfs(grid,i,m-1);}for(int j=0;j<m;j++){dfs(grid,0,j);dfs(grid,n-1,j);}int ans=0;for(int i=0;i<n;i++){for(int j =0;j<m;j++){if(grid[i][j]==1 && !visted[i][j]){ans+=1;}}}return ans;}public void dfs(int[][]grid,int x,int y){if (x<0 || x>=n || y<0 || y>=m || grid[x][y]==0 || visted[x][y]){return;}visted[x][y]=true;for(int[] dir:dirs){dfs(grid,x+dir[0],y+dir[1]);}}
}

例题5 被围绕的区域

https://leetcode.cn/problems/surrounded-regions/description/

class Solution:def solve(self, board: List[List[str]]) -> None:"""Do not return anything, modify board in-place instead."""n=len(board)m=len(board[0])visted=[[0]*m for _ in range(n)]def dfs(x,y):if 0<=x<n and 0<=y<m and board[x][y]=='O' and not visted[x][y]:visted[x][y]=1for dx,dy in (0,1),(0,-1),(1,0),(-1,0):dfs(x+dx,y+dy)else:returnfor i in range(n):dfs(i,0)dfs(i,m-1)for j in range(m):dfs(0,j)dfs(n-1,j)for i in range(n):for j in range(m):if board[i][j]=='O' and visted[i][j]==0 :board[i][j]='X'

例题6 太平洋大西洋水流问题

https://leetcode.cn/problems/pacific-atlantic-water-flow/description/

class Solution:def pacificAtlantic(self, heights: List[List[int]]) -> List[List[int]]:n=len(heights)m=len(heights[0])pacific =[[0]*m for _ in range(n)]atlantic=[[0]*m for _ in range(n)]ans=[]def dfs(x,y,grid):grid[x][y]=1for dx,dy in (0,1),(0,-1),(1,0),(-1,0):nx=x+dxny=y+dyif 0<=nx<n and 0<=ny<m and heights[nx][ny]>=heights[x][y] and grid[nx][ny]==0:dfs(nx,ny,grid)for i in range(n):for j in range(m):if j==0 or i==0:dfs(i,j,pacific)if i==n-1 or j==m-1:atlantic[i][j]=1dfs(i,j,atlantic)for i in range(n):for j in range(m):if pacific[i][j]==1 and atlantic[i][j]==1:ans.append([i,j])return ans

例题7 钥匙和房间

https://leetcode.cn/problems/keys-and-rooms/

class Solution:def canVisitAllRooms(self, rooms: List[List[int]]) -> bool:n=len(rooms)visted=[0]*ndef dfs(x):if visted[x]:returnvisted[x]=1for nx in rooms[x]:dfs(nx)dfs(0)return sum(visted)==n

例题8 寻找图中是否存在路径

https://leetcode.cn/problems/find-if-path-exists-in-graph/description/

class Solution:def validPath(self, n: int, edges: List[List[int]], source: int, destination: int) -> bool:parent=[i for i in range(n)]def find(x):if x==parent[x]:return xparent[x]=find(parent[x])return find(parent[x])def union(x,y):px=find(x)py=find(y)if px!=py:parent[px]=pyfor u,v in edges:if find(u)!=find(v):union(u,v)return find(source)==find(destination)

例题9 冗余连接

https://leetcode.cn/problems/redundant-connection/description/

class Solution:def findRedundantConnection(self, edges: List[List[int]]) -> List[int]:n=len(edges)parent=[i for i in range(n+1)]def find(x):if x==parent[x]:return xparent[x]=find(parent[x])return find(parent[x])def union(x,y):px=find(x)py=find(y)if px !=py:parent[px]=pyfor u,v in edges:if find(u)==find(v):return [u,v]else:union(u,v)

例题10 课程表 拓扑排序

https://leetcode.cn/problems/course-schedule/description/

import collections
class Solution:def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool:edges=collections.defaultdict(list)visted=[0]*numCoursesrestult=[]valid = Truefor u,v in prerequisites:edges[v].append(u)def dfs(u):nonlocal validvisted[u]=1for v in edges[u]:if visted[v]==0:dfs(v)if not valid:returnelif visted[v]==1:valid=Falsereturnvisted[u]=2restult.append(u)for i in range(numCourses):if valid and not visted[i]:dfs(i)return valid
import collections
class Solution:def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool:edges=collections.defaultdict(list)indeg=[0]*numCoursesfor u,v in prerequisites:edges[v].append(u)indeg[u]+=1queue = [u for u in range(numCourses) if indeg[u]==0]visted =0while queue:u = queue.pop(0)visted+=1for v in edges[u]:indeg[v]-=1if indeg[v]==0:queue.append(v)return visted==numCourses

例题11 单词接龙

https://leetcode.cn/problems/word-ladder/description/

class Solution:def ladderLength(self, beginWord: str, endWord: str, wordList: List[str]) -> int:wordList = set(wordList)if endWord not in wordList:return 0q = deque([(beginWord, 1)])while q:cur, step = q.popleft()for i, x in enumerate(cur):for y in [chr(ord('a')+i) for i in range(26)]:if y != x:nxt = cur[:i] + y + cur[i+1:]if nxt == endWord:return step + 1if nxt in wordList:wordList.remove(nxt)q.append((nxt, step+1))return 0

例题12 最小高度树

https://leetcode.cn/problems/minimum-height-trees/description/

import collections
class Solution:def findMinHeightTrees(self, n: int, edges: List[List[int]]) -> List[int]:graph=collections.defaultdict(list)res=[]for u,v in edges:graph[u].append(v)graph[v].append(u)def dfs(u):ans=1visted[u]=1for v in graph[u]:if visted[v]==0:vh=dfs(v)#             print(u,v,vh)ans=max(ans,vh+1)return ansvisted=[0]*nres.append([0,dfs(0)])for i in range(1,n):visted=[0]*ntmp=dfs(i)if tmp<res[-1][-1]:res=[[i,tmp]]elif tmp==res[-1][-1]:res.append([i,tmp])return [u for u,v in res]

例题13 省份数量

https://leetcode.cn/problems/number-of-provinces/description/
1.利用并查集

class Solution:def findCircleNum(self, isConnected: List[List[int]]) -> int:n=len(isConnected)par=[i for i in range(n+1)]def find(x):if x==par[x]:return xpar[x]=find(par[x])return find(par[x])for i in range(n):for j in range(n):if i!=j and isConnected[i][j]==1:pi=find(i+1)pj= find(j+1)par[pi]=pjfor i in range(n+1):par[i]=find(i)return len(set(par))-1
class Solution:def findCircleNum(self, isConnected: List[List[int]]) -> int:n=len(isConnected)visted=[0]*nans=0def dfs(x):visted[x]=1for j in range(n):if isConnected[x][j]==1 and visted[j]==0:dfs(j)for i in range(n):if visted[i]==0:dfs(i)ans+=1return ans

例题14 判断二分图

https://leetcode.cn/problems/is-graph-bipartite/

class Solution:def __init__(self):self.ans = Truedef isBipartite(self, graph: List[List[int]]) -> bool:n=len(graph)par=[i for i in range(n)]visted=[0]*ndef dfs(x,flag):if not self.ans :return self.anspar[x]=flag visted[x]=1#     print(x,visted,dic)for nx in graph[x]:if visted[nx]==1:# print(x,nx,flag,par[nx],par[nx] == flag,dic,visted)if par[nx] == flag:self.ans = Falseelse:dfs(nx,1-flag)return self.ansres=Truefor i in range(n):if visted[i]==0:res = res and dfs(i,0)return res
class Solution:def isBipartite(self, graph: List[List[int]]) -> bool:n=len(graph)visted=[0]*ncolor=[0]*nvalid = Truedef dfs(x,c):nonlocal validcolor[x]=cvisted[x]=1for nx in graph[x]:if visted[nx]==0:dfs(nx,1-c)if not valid:returnelif color[nx]!=1-c:valid=Falsereturnfor i in range(n):if visted[i]==0:dfs(i,0)if not valid:breakreturn valid
class Solution:def isBipartite(self, graph: List[List[int]]) -> bool:n=len(graph)visted=[0]*ncolor=[0]*nfor i in range(n):if visted[i]==0:  #初始化q=collections.deque([i])color[i]=0visted[i]=1while q:x=q.popleft()for nx in graph[x]:if visted[nx]==0:color[nx]=1-color[x]q.append(nx)visted[nx]=1elif color[nx]==color[x]:return Falsereturn True
class Solution {public boolean isBipartite(int[][] graph) {int n=graph.length;int[] color = new int[n];int[] visted = new int[n];Arrays.fill(visted,0);for(int i=0;i<n;i++){if(visted[i]==0){Queue<Integer> queue =new LinkedList<Integer>();queue.offer(i);color[i]=0;visted[i]=1;while(!queue.isEmpty()){int x = queue.poll();for(int nx :graph[x]){if(visted[nx]==0){color[nx]=1-color[x];visted[nx]=1;queue.offer(nx);}else if (color[nx]==color[x]) return false;}}}}return true;}
}
class Solution {private static int[] color;private static int[] visted;private static boolean valid;public boolean isBipartite(int[][] graph) {int n = graph.length;color = new int[n];visted= new int[n];valid = true;Arrays.fill(visted,0);for(int i=0;i<n;i++){if(visted[i]==0){dfs(i,0,graph);if(!valid){break;}}}return valid;}public void dfs(int x,int c,int[][] graph){visted[x]=1;color[x]=c;for(int nx:graph[x]){if (visted[nx]==0){dfs(nx,1-c,graph);if(!valid)return;}else if(color[nx]==c){valid=false;return;}}}
}

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

如若内容造成侵权/违法违规/事实不符,请联系dt猫网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

思腾合力受邀出席文化和旅游虚拟现实应用推广交流活动并作主题演讲

3月21日&#xff0c;由文化和旅游部产业发展司主办&#xff0c;中国信息通信研究院、北京市石景山区文化和旅游局、中国动漫集团有限公司承办的“数字赋能文旅场景建设行动——文化和旅游虚拟现实应用推广交流活动”在北京首钢一高炉SoReal科幻乐园成功举办。 思腾合力CMO徐莉受…

unity学习(71)——编译游戏发生错误3——回调问题——必须使用mapHandker的update

move这种一直发送的&#xff0c;第一次写&#xff0c;之前的数据包收发都是一次性的来完成单次任务&#xff01; 1.服务器最后一次出问题时的调试状态如下&#xff1a; 2.定位代码如下 可见确实LogicHandler了&#xff0c;也确实直行到119行的位置了 3.修改catch&#xff0c…

GPT提示词分享 —— 写作标题生成器

我想让你充当书面作品的标题生成器。我将向你提供一篇文章的主题和关键词&#xff0c;你将生成五个吸引人的标题。请保持标题简洁&#xff0c;不超过 20 个字&#xff0c;并确保保持其含义。答复时要利用题目的语言类型。我的第一个题目是 [文章内容] 3.5的回答&#x1f447;fr…

C++第十三弹---内存管理(下)

✨个人主页&#xff1a; 熬夜学编程的小林 &#x1f497;系列专栏&#xff1a; 【C语言详解】 【数据结构详解】【C详解】 目录 1、operator new与operator delete函数 1.1、operator new与operator delete函数 2、new和delete的实现原理 2.1、内置类型 2.2、自定义类型 …

HTTP系列之HTTP缓存 —— 强缓存和协商缓存

文章目录 HTTP缓存强缓存协商缓存状态码区别缓存优先级如何设置强缓存和协商缓存使用场景 HTTP缓存 HTTP缓存时利用HTTP响应头将所请求的资源在浏览器进行缓存&#xff0c;缓存方式分两种&#xff1a;强缓存和协商缓存。 浏览器缓存是指将之前请求过的资源在浏览器进行缓存&am…

Qt creator构建DLL库

文章目录 一、构建DLL库二、隐式调用DLL库 一、构建DLL库 Qt creator创建DLL项目。 实现功能函数。 运行代码&#xff0c;debug目录下会有.dll和.lib文件。 二、隐式调用DLL库 QT新建控制台项目。将.lib文件和与之关联的头文件赋值到项目文件夹。 3. 添加头文件和外部依赖库…

数据可视化-ECharts Html项目实战(6)

在之前的文章中&#xff0c;我们学习了如何设置散点图、雷达图。想了解的朋友可以查看这篇文章。同时&#xff0c;希望我的文章能帮助到你&#xff0c;如果觉得我的文章写的不错&#xff0c;请留下你宝贵的点赞&#xff0c;谢谢数据可视化-ECharts Html项目实战&#xff08;5&a…

【数据分析面试】2.连续访问最长天数用户(SQL)

题目 给定一个包含事件日志的表格&#xff0c;找出连续访问平台时间最长的前五个用户。 注意&#xff1a;连续访问是指用户在连续的几天内每天至少访问一次平台。 示例&#xff1a; 输入&#xff1a; events 表 ColumnTypeuser_idINTEGERcreated_atDATETIMEurlVARCHAR 输…

学习人工智能:Attention Is All You Need-2-Transformer模型;Attention机制;位置编码

3.2 注意力机制Attention 注意力函数可以描述为将查询和一组键值对映射到输出的过程&#xff0c;其中查询、键、值和输出都是向量。输出被计算为值的加权和&#xff0c;其中每个值的权重由查询与相应键的兼容性函数计算得出。 3.2.1 缩放点积注意力 Scaled Dot-Product Attenti…

Python——jieba优秀的中文分词库(基础知识+实例)

Hello&#xff0c;World&#xff01; 从去年开始学习Python&#xff0c;在长久的学习过程中&#xff0c;发现了许多有趣的知识&#xff0c;不断充实自己。今天我所写的内容也是极具趣味性&#xff0c;关于优秀的中文分词库——jieba库。 &#x1f3d4;关于Jieba &#x1f412;…

BUG定位---一起学习吧之测试

判断一个BUG是前端还是后端的&#xff0c;通常需要根据BUG的具体表现、发生的环境以及相关的技术栈来进行分析。以下是一些常用的判断方法&#xff1a; 错误发生的位置&#xff1a; 如果BUG涉及的是页面的布局、样式、交互效果等&#xff0c;那么很可能是前端的BUG。如果BUG与…

鸿蒙HarmonyOS应用开发之NDK工程构建概述

OpenHarmony NDK默认使用CMake作为构建系统&#xff0c;随包提供了符合OpenHarmony工具链的基础配置文件 ohos.toolchain.cmake &#xff0c;用于预定义CMake变量来简化开发者配置。 常用的NDK工程构建方式有&#xff1a; 从源码构建 源码构建也有不同方式&#xff1a; 可以使…

29---Nor Flash电路设计

视频链接 Nor Flash硬件电路设计01_哔哩哔哩_bilibili NOR FLASH电路设计 1、NOR FLASH介绍 NOR Flash最早是由Intel公司于1988年开发出的。 NOR Flash虽容量小但速度快,最大特点是支持芯片内执行&#xff08;XIP&#xff09;&#xff0c;即程序可以直接在NOR flash的片内…

Spring Cloud Gateway Server MVC

之前你如果要用spring cloud gateway &#xff0c;就必须是webflux 的&#xff0c;也就是必须是异步响应式编程。不能和spring mvc 一起使用。现在spring cloud 新出了一个可以不用webflux的gateway。 具体使用mvc的gateway步骤如下 普通的Eureka Client的项目 如果你只是想测…

前端Webpack5高级进阶课程

课程介绍 本套视频教程主要内容包含React/Vue最新版本脚手架分析、基于Webpack5编写自己的loader和plugin等&#xff0c;让你开发时选择更多样&#xff0c;最后&#xff0c;用不到一百行的代码实现Webpack打包。通过本套视频教程的学习&#xff0c;可以帮你彻底打通Webpack的任…

CCleaner2024最新版本win系统清理工具功能介绍及下载

CCleaner是一款在计算机领域广受欢迎的系统清理和优化工具。它以其强大的功能、简洁的操作界面和显著的效果&#xff0c;赢得了众多用户的青睐。下面&#xff0c;我将从功能、特点、使用方法以及优势等方面对CCleaner进行详细介绍。 CCleaner下载如下&#xff1a; https://wm.…

一题学会BFS和DFS,手撕不再怕

先复习一下什么是BFS和DFS&#xff0c;各位读者接着往下看就行 BFS算法 BFS类似于树的层次遍历过程,从根节点开始&#xff0c;沿着树的宽度遍历树的节点。如果所有节点均被访问&#xff0c;则算法中止。 舍去空间换时间。 算法思路队列&#xff08;先进先出&#xff09; 1…

红外遥控器的使用和详细解释

infrared.c #include "infrared.h"/* 红外 --- PA8*/void Infrared_Init(void) {GPIO_InitTypeDef GPIO_InitStruct; EXTI_InitTypeDef EXTI_InitStruct;NVIC_InitTypeDef NVIC_InitStruct;//使能SYSCFG时钟RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, E…

如何绕过CDN查真实IP

1.多地ping看是否有cdn 2.邮件订阅或者rss订阅 二级域名可能不会做cdnnslookup http://xxx.com 国外dns查找域名历史解析记录&#xff0c;因为域名在上CDN之前用的IP&#xff0c;很有可能就是CDN的真实源IP地址6.phpinfo上显示的信息 cloudflare github可以获取真实IP一个网站…

JAVA电商平台 免 费 搭 建 B2B2C商城系统 多用户商城系统 直播带货 新零售商城 o2o商城 电子商务 拼团商城 分销商城

在数字化时代&#xff0c;电商行业正经历着前所未有的变革。鸿鹄云商的saas云平台以其独特的架构和先进的理念&#xff0c;为电商行业带来了全新的商业模式和营销策略。该平台涉及多个平台端&#xff0c;包括平台管理、商家端、买家平台、微服务平台等&#xff0c;涵盖了pc端、…