MGraph圖(代碼、分析、匯編)

目錄:

    • 代碼:
    • 分析:
    • 匯編:

MGrapth圖表示有鄰接矩陣的方式構成的圖結構。
鄰接矩陣用兩個數組保存數據,一個一維數組存儲圖中的頂點信息,一個二維數組存儲圖中邊或弧的信息。

無向圖中的二維數組是個對稱矩陣
1.0表示無邊,1表示有邊
2.頂點的度是行內數組之和
3.求取頂點鄰接占,將行內元素遍歷下

有向圖的鄰接矩陣(二維數組),
有分入度和出度,行內之和是出度,列內之和是入度

代碼:

LinkQueue.h

#ifndef _LINKQUEUE_H_
#define _LINKQUEUE_H_typedef void LinkQueue;LinkQueue* LinkQueue_Create();void LinkQueue_Destroy(LinkQueue* queue);void LinkQueue_Clear(LinkQueue* queue);int LinkQueue_Append(LinkQueue* queue, void* item);void* LinkQueue_Retrieve(LinkQueue* queue);void* LinkQueue_Header(LinkQueue* queue);int LinkQueue_Length(LinkQueue* queue);#endif

LinkQueue.c

#include <malloc.h>
#include <stdio.h>
#include "LinkQueue.h"typedef struct _tag_LinkQueueNode TLinkQueueNode;//定義隊列節點類型
struct _tag_LinkQueueNode
{TLinkQueueNode* next;void* item;
};typedef struct _tag_LinkQueue//定義隊列類型
{TLinkQueueNode* front;TLinkQueueNode* rear;int length;
} TLinkQueue;LinkQueue* LinkQueue_Create() //定義創建隊列函數
{TLinkQueue* ret = (TLinkQueue*)malloc(sizeof(TLinkQueue));if( ret != NULL ){ret->front = NULL;ret->rear = NULL;ret->length = 0;}return ret;
}void LinkQueue_Destroy(LinkQueue* queue) // 定義銷毀隊列函數
{LinkQueue_Clear(queue);free(queue);
}void LinkQueue_Clear(LinkQueue* queue) // 定義清空隊列函數
{while( LinkQueue_Length(queue) > 0 ){LinkQueue_Retrieve(queue);}
}int LinkQueue_Append(LinkQueue* queue, void* item) // 定義進隊列函數
{TLinkQueue* sQueue = (TLinkQueue*)queue;//取得隊列TLinkQueueNode* node = (TLinkQueueNode*)malloc(sizeof(TLinkQueueNode));//新建節點int ret = (sQueue != NULL ) && (item != NULL) && (node != NULL);if( ret ){node->item = item;//給新建節點保存的數據賦值if( sQueue->length > 0 )//如果長度大于0{sQueue->rear->next = node;//將隊列最后一個節點的next指向新建節點sQueue->rear = node;//設新建節點為最后節點 node->next = NULL;}else//否則 表示是第一個節點{sQueue->front = node;//設第一個節點為新建節點sQueue->rear = node;//設最后一個節點為新建節點node->next = NULL;}sQueue->length++;}if( !ret )//條件不成功{free(node);//釋放新建節點}return ret;
}void* LinkQueue_Retrieve(LinkQueue* queue) // 定義出隊列函數
{TLinkQueue* sQueue = (TLinkQueue*)queue;//取得隊列TLinkQueueNode* node = NULL;void* ret = NULL;if( (sQueue != NULL) && (sQueue->length > 0) ){node = sQueue->front;//取得出隊列節點sQueue->front = node->next;//將隊列第一個節點設為取出節點的下一個ret = node->item;//取得節點保存的數據free(node);//釋放出隊列節點sQueue->length--;if( sQueue->length == 0 )//如果是最后一個節點{sQueue->front = NULL;//將第一個節點指針清空sQueue->rear = NULL;//將最后一個節點指針清空}}return ret;
}void* LinkQueue_Header(LinkQueue* queue) // 定義獲取第一個節點數據函數
{TLinkQueue* sQueue = (TLinkQueue*)queue;void* ret = NULL;if( (sQueue != NULL) && (sQueue->length > 0) ){ret = sQueue->front->item;}return ret;
}int LinkQueue_Length(LinkQueue* queue) // 定義獲取隊列長度函數
{TLinkQueue* sQueue = (TLinkQueue*)queue;int ret = -1;if( sQueue != NULL ){ret = sQueue->length;}return ret;
}

MGraph.h


#ifndef _MGRAPH_H_
#define _MGRAPH_H_typedef void MGraph;//定義圖類型
typedef void MVertex;//定義頂點類型
typedef void (MGraph_Printf)(MVertex*);//定義有一個頂點類型指針參數并且無返回值的函數類型MGraph* MGraph_Create(MVertex** v, int n);//聲明創建圖函數void MGraph_Destroy(MGraph* graph);//聲明銷毀圖函數void MGraph_Clear(MGraph* graph);//聲明清空圖函數int MGraph_AddEdge(MGraph* graph, int v1, int v2, int w);//聲明添加邊函數int MGraph_RemoveEdge(MGraph* graph, int v1, int v2);//聲明移除邊函數int MGraph_GetEdge(MGraph* graph, int v1, int v2);//聲明獲取邊函數int MGraph_TD(MGraph* graph, int v);//聲明以一個數作為行與列檢測不等于0的值的數量函數int MGraph_VertexCount(MGraph* graph);//聲明獲取頂點數量函數int MGraph_EdgeCount(MGraph* graph);//聲明獲取邊數量函數void MGraph_DFS(MGraph* graph, int v, MGraph_Printf* pFunc);//聲明void MGraph_BFS(MGraph* graph, int v, MGraph_Printf* pFunc);//聲明void MGraph_Display(MGraph* graph, MGraph_Printf* pFunc);//聲明#endif

MGraph.c

#include <malloc.h>
#include <stdio.h>
#include "MGraph.h"
#include "LinkQueue.h"typedef struct _tag_MGraph//定義實際使用圖類型
{int count;//數量MVertex** v;//指向頂點指針的指針變量int** matrix;//指向整型指針的指針變量
} TMGraph;//遞歸遍歷矩陣函數 
static void recursive_dfs(TMGraph* graph, int v, int visited[], MGraph_Printf* pFunc)
{int i = 0;pFunc(graph->v[v]);visited[v] = 1;printf(", ");for(i=0; i<graph->count; i++){if( (graph->matrix[v][i] != 0) && !visited[i] ){recursive_dfs(graph, i, visited, pFunc);}}
}
//用隊列遍歷矩陣
static void bfs(TMGraph* graph, int v, int visited[], MGraph_Printf* pFunc)
{LinkQueue* queue = LinkQueue_Create();//創建隊列if( queue != NULL )//創建成功{LinkQueue_Append(queue, graph->v + v);//將頂點信息存進隊列visited[v] = 1;//將對應行記錄為已查看while( LinkQueue_Length(queue) > 0 ){int i = 0;v = (MVertex**)LinkQueue_Retrieve(queue) - graph->v;pFunc(graph->v[v]);printf(", ");for(i=0; i<graph->count; i++){if( (graph->matrix[v][i] != 0) && !visited[i] ){LinkQueue_Append(queue, graph->v + i);visited[i] = 1;}}}}LinkQueue_Destroy(queue);
}MGraph* MGraph_Create(MVertex** v, int n)  // 定義創建圖函數
{TMGraph* ret = NULL;if( (v != NULL ) && (n > 0) ){ret = (TMGraph*)malloc(sizeof(TMGraph));//新建圖if( ret != NULL )//新建成功{int* p = NULL;ret->count = n;//設置數量ret->v = (MVertex**)malloc(sizeof(MVertex*) * n);//創建n個頂點指針類型的空間,v指向第一個ret->matrix = (int**)malloc(sizeof(int*) * n);//創建n個整型指針類型的空間,matrix指向第一個p = (int*)calloc(n * n, sizeof(int));//創建n*n個int 類型空間,p指向第一個if( (ret->v != NULL) && (ret->matrix != NULL) && (p != NULL) )//全部創建成功{int i = 0;for(i=0; i<n; i++){ret->v[i] = v[i];//將傳來的頂點信息給新建的圖中的頂點賦值ret->matrix[i] = p + i * n;//將新建圖中的矩陣指向p創建的地址(0,6,12,18,24,30)}}else//如果創建失敗,將申請的空間全部釋放{free(p);free(ret->matrix);free(ret->v);free(ret);ret = NULL;//返回空}}}return ret;
}void MGraph_Destroy(MGraph* graph) //定義銷毀圖函數
{TMGraph* tGraph = (TMGraph*)graph;//取得圖if( tGraph != NULL )//圖不為空,將空間全部釋放{free(tGraph->v);free(tGraph->matrix[0]);free(tGraph->matrix);free(tGraph);}
}void MGraph_Clear(MGraph* graph) // 定義清空圖函數
{TMGraph* tGraph = (TMGraph*)graph;//取得圖if( tGraph != NULL )//圖不為空{int i = 0;int j = 0;for(i=0; i<tGraph->count; i++){for(j=0; j<tGraph->count; j++){tGraph->matrix[i][j] = 0;//將矩陣數值全設0}}}
}int MGraph_AddEdge(MGraph* graph, int v1, int v2, int w) // 定義添加邊函數
{TMGraph* tGraph = (TMGraph*)graph;//取得圖int ret = (tGraph != NULL);//判斷是否為空ret = ret && (0 <= v1) && (v1 < tGraph->count);//判斷行數是否正常ret = ret && (0 <= v2) && (v2 < tGraph->count);//判斷列數是否正常ret = ret && (0 <= w);//判斷添加的值是否大于等于0if( ret )//條件成功{tGraph->matrix[v1][v2] = w;//將對應行列值修改}return ret;//返回是否成功
}int MGraph_RemoveEdge(MGraph* graph, int v1, int v2) // 定義移除邊函數
{int ret = MGraph_GetEdge(graph, v1, v2);//獲取移除的值if( ret != 0 )//圖不為空{((TMGraph*)graph)->matrix[v1][v2] = 0;//將對應行列值重置0}return ret;//返回移除值
}int MGraph_GetEdge(MGraph* graph, int v1, int v2) // 定義獲取邊函數
{TMGraph* tGraph = (TMGraph*)graph;//獲取圖int condition = (tGraph != NULL);//判斷圖不為空int ret = 0;condition = condition && (0 <= v1) && (v1 < tGraph->count);//判斷行是否正常condition = condition && (0 <= v2) && (v2 < tGraph->count);//判斷列是否正常if( condition ){ret = tGraph->matrix[v1][v2];//獲取對應行列的值}return ret;//返回對應值
}int MGraph_TD(MGraph* graph, int v) // 定義以一個數作為行與列檢測不等于0的值的數量函數
{TMGraph* tGraph = (TMGraph*)graph;//取得圖int condition = (tGraph != NULL);//判斷圖不為空int ret = 0;condition = condition && (0 <= v) && (v < tGraph->count);//判斷v是否在范圍內if( condition ){int i = 0;for(i=0; i<tGraph->count; i++)//如果一個位置的數值有效在行列交叉處會增加兩次{if( tGraph->matrix[v][i] != 0 )//如果以v作為行數將對應行列的值不等于0{ret++;//數量增加}if( tGraph->matrix[i][v] != 0 )//如果以v作為列數將對應行列的值不等于0{ret++;//數量增加}}}return ret;//返回總數
}int MGraph_VertexCount(MGraph* graph) //定義獲取頂點數量
{TMGraph* tGraph = (TMGraph*)graph;int ret = 0;if( tGraph != NULL ){ret = tGraph->count;//取得數量}return ret;
}int MGraph_EdgeCount(MGraph* graph) //定義獲取邊數函數
{TMGraph* tGraph = (TMGraph*)graph;int ret = 0;if( tGraph != NULL ){int i = 0;int j = 0;for(i=0; i<tGraph->count; i++){for(j=0; j<tGraph->count; j++){if( tGraph->matrix[i][j] != 0 )//如果不等于0{ret++;//數量增加}}}}return ret;//返回總數
}//從v行開始遍歷矩陣,visited記錄查看過的行。輸出v行頂點信息,從v行i列開始,只要i列不等于0并且用i值作為行檢測
//i值行沒有看過。就跳到i行查看,此時i作為新v行又從v行i列開始檢測。循環檢測完矩陣每個元素
void MGraph_DFS(MGraph* graph, int v, MGraph_Printf* pFunc)
{TMGraph* tGraph = (TMGraph*)graph;//取得圖int* visited = NULL;int condition = (tGraph != NULL);//圖不為空condition = condition && (0 <= v) && (v < tGraph->count);//v是否在范圍內condition = condition && (pFunc != NULL);//函數指針不為空//判斷新申請的count個int類型是否成功condition = condition && ((visited = (int*)calloc(tGraph->count, sizeof(int))) != NULL);if( condition ){int i = 0;recursive_dfs(tGraph, v, visited, pFunc);//調用遞歸檢測for(i=0; i<tGraph->count; i++)//如果還有行沒遍歷的,再從該行開始遍歷{if( !visited[i] ){recursive_dfs(tGraph, i, visited, pFunc);}}printf("\n");}free(visited);//釋放用于記錄查看行狀態的空間
}
//從v行開始遍歷,visited記錄查看過的行
//將v行對應頂點信息存進隊列,表示從該行開始遍歷,將v行記錄為已查看,輸出v行頂點信息
//然后從出隊列的行開始遍歷,如果v行i列不等于0并且將i作為行檢測是否查看過
//如果沒有將i作為要遍歷的行進隊列,當前v行檢測完,再從隊列取元素循環同樣操作
void MGraph_BFS(MGraph* graph, int v, MGraph_Printf* pFunc)
{TMGraph* tGraph = (TMGraph*)graph;//取得圖int* visited = NULL;int condition = (tGraph != NULL);condition = condition && (0 <= v) && (v < tGraph->count);condition = condition && (pFunc != NULL);condition = condition && ((visited = (int*)calloc(tGraph->count, sizeof(int))) != NULL);if( condition ){int i = 0;bfs(tGraph, v, visited, pFunc);for(i=0; i<tGraph->count; i++)//如果還有行沒遍歷的,再從該行開始遍歷{if( !visited[i] ){bfs(tGraph, i, visited, pFunc);}}printf("\n");}free(visited);//釋放用于記錄查看行狀態的空間
}
//將矩陣中不為0的數值,將其坐標與數值輸出
void MGraph_Display(MGraph* graph, MGraph_Printf* pFunc) // O(n*n)
{TMGraph* tGraph = (TMGraph*)graph;//取得圖if( (tGraph != NULL) && (pFunc != NULL) )//圖與函數指針不為空{int i = 0;int j = 0;for(i=0; i<tGraph->count; i++)//輸出所有頂點信息{printf("%d:", i);pFunc(tGraph->v[i]);printf(" ");}printf("\n");for(i=0; i<tGraph->count; i++){for(j=0; j<tGraph->count; j++){if( tGraph->matrix[i][j] != 0 )//將矩陣中不等于0的坐標與數據輸出{printf("<");pFunc(tGraph->v[i]);//輸出行printf(", ");pFunc(tGraph->v[j]);//輸出列printf(", %d", tGraph->matrix[i][j]);//輸出對應數據printf(">");printf(" ");}}}printf("\n");}
}

main.c

#include <stdio.h>
#include <stdlib.h>
#include "MGraph.h"void print_data(MVertex* v)
{printf("%s", (char*)v);
}int main(int argc, char *argv[])
{MVertex* v[] = {"A", "B", "C", "D", "E", "F"};MGraph* graph = MGraph_Create(v, 6);MGraph_AddEdge(graph, 0, 1, 1);MGraph_AddEdge(graph, 0, 2, 1);MGraph_AddEdge(graph, 0, 3, 1);MGraph_AddEdge(graph, 1, 5, 1);MGraph_AddEdge(graph, 1, 4, 1);MGraph_AddEdge(graph, 2, 1, 1);MGraph_AddEdge(graph, 3, 4, 1);MGraph_AddEdge(graph, 4, 2, 1);MGraph_Display(graph, print_data);MGraph_DFS(graph, 0, print_data);//輸出:A,B,E,C,F,DMGraph_BFS(graph, 0, print_data);//輸出:A,B,C,D,E,FMGraph_Destroy(graph);getchar();return 0;
}

分析:

在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述

匯編:

在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/379151.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/379151.shtml
英文地址,請注明出處:http://en.pswp.cn/news/379151.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

java: 程序包lombok不存在_Java開發神器:Lombok 學習指南

點擊上方“Java知音”&#xff0c;選擇“置頂公眾號”技術文章第一時間送達&#xff01;作者&#xff1a;semlinkerwww.segmentfault.com/a/1190000020864572一、Lombok 簡介Lombok 是一款 Java 開發插件&#xff0c;使得 Java 開發者可以通過其定義的一些注解來消除業務工程中…

Python---編程檢查并判斷密碼字符串的安全強度

編程檢查并判斷密碼字符串的安全強度 passwordinput("請輸入你的密碼&#xff1a;") plist(password) x0 for i in p:if i " ":x1 if x1:print("密碼格式不對")#密碼中不能包含空格 elif password.isdigit()True or password.isalpha()True:#全…

CFUpdate上傳控件的使用

一同事找的這個控件&#xff0c;覺得挺不錯的&#xff0c;到官方(http://www.access2008.cn/)下載源碼后稍加修改 html頁面代碼&#xff1a; <html xmlns"http://www.w3.org/1999/xhtml" xml:lang"zh_cn" lang"zh_cn"> <head> <m…

observable_Java Observable addObserver()方法與示例

observable可觀察的類addObserver()方法 (Observable Class addObserver() method) addObserver() method is available in java.util package. addObserver()方法在java.util包中可用。 addObserver() method is used to insert the given observer (obs) to the bundles of o…

AAC ADTS格式分析

AAC ADTS格式分析&#xff1a; 沒有詳細的參數說明&#xff0c;只有格式分析。可以查詢文檔查看詳細參數說明。 ADTS的全稱是Audio Data Transport Stream。是AAC音頻的傳輸流格 式。AAC音頻格式在MPEG-2&#xff08;ISO-13318-7 2003&#xff09;中有定義。AAC后來 又被采用到…

新知道的幾個東西

nginx&#xff08;發音同engine x&#xff09;是一款由俄羅斯程序設計師Igor Sysoev所開發輕量級的網頁服務器、反向代理服務器以及電子郵件&#xff08;IMAP/POP3&#xff09;代理服務器。起初是供俄國大型的入口網站及搜尋引擎Rambler&#xff08;俄文&#xff1a;Рамбл…

臺達plc控制伺服電機編程實例_PLC控制伺服電機:控制脈沖的相關計算

伺服電機PLC通過脈沖的方式控制伺服電機時&#xff0c;其輸出脈沖與伺服電機的配置應具有一定的對應關系。如&#xff0c;PLC輸出多少個脈沖電機旋轉一圈&#xff1f;電機旋轉一圈移動的距離(或角度)是多少&#xff1f;這里我們以某伺服電機為例進行舉例說明&#xff1a;完成對…

linux rm命令詳解

用戶可以用rm命令刪除不需要的文件。該命令的功能為刪除一個目錄中的一個或多個文件或目錄&#xff0c;它也可以將某個目錄及其下的所有文件及子目錄均刪除。對于鏈接文件&#xff0c;只是斷開了鏈接&#xff0c;原文件保持不變。 rm命令的一般形式為&#xff1a;rm [選項] 文件…

rotateright_Java Long類rotateRight()方法的示例

rotateright長類rotateRight()方法 (Long class rotateRight() method) rotateRight() method is available in java.lang package. rotationRight()方法在java.lang包中可用。 rotateRight() method is used to returns the value generated by rotating the binary 2’s comp…

實驗四 Windows程序設計

1&#xff0c;創建Windows窗體應用程序&#xff0c;實現用戶登錄功能&#xff0c;當輸入正確與錯誤時均給出相應的提示信息&#xff0c;規定用戶輸入錯誤次數不能超過3次。&#xff08;源代碼運行界面&#xff09; 這里的口令有個小常識&#xff0c;就是顯示*&#xff0c;在口令…

最小連通-(代碼、分析、匯編)

目錄&#xff1a;介紹&#xff1a;代碼&#xff1a;分析&#xff1a;匯編&#xff1a;介紹&#xff1a; 一個有 n 個結點的連通圖的生成樹是原圖的極小連通子圖&#xff0c;且包含原圖中的所有 n 個結點&#xff0c; 并且有保持圖連通的最少的邊。 最小生成樹可以用kruskal&am…

toad dba for oracle 10.5

http://worlddownloads.quest.com.edgesuite.net/Repository/support.quest.com/Toad%20for%20Oracle/10.5/Software/Toad%20DBA%20Suite%20for%20Oracle%2010.5%20Commercial.exe轉載于:https://www.cnblogs.com/devbar/archive/2010/07/01/1768986.html

c++ 怎樣連接兩個鏈表_LeetCode | 鏈表的入口,一文幫你搞定“環形鏈表”(python版,最簡單解析)...

鏈表節點的定義鏈表作為一種數據結構&#xff0c;由鏈表節點互相連接構成。鏈表節點包含自身的數據和一個指向下一節點的指針。""" Definition of ListNode """ class ListNode(object):def __init__(self, val, nextNone):self.val valself.ne…

QI實例-改變空間參考

學習AE一段時間了&#xff0c;總是對QI不是很理解&#xff0c;今天一晚上寫了QI實例&#xff0c;嘗試理解下。 首先想到的是→改變空間參考→alter、SpatialReference→alterSpatialReference&#xff0c;輸入到幫助文檔里。  查看是IGeoDatasetSchemaEdit接口的方法&#xf…

VeryCD 的資料庫

呵呵&#xff0c;剛才看了下VeryCD的資料庫&#xff0c;恍然間才明白為什么VeryCD以前花大量時間和精力開發電驢&#xff0c;又為什么不久前突然取消了KAD網絡和ED2k網絡的搜索功能。呵呵&#xff0c;天下沒有免費的午餐哈&#xff0c;VeryCD先用電驢軟件聚集客戶群&#xff08…

Java IdentityHashMap keySet()方法及示例

IdentityHashMap類keySet()方法 (IdentityHashMap Class keySet() method) keySet() method is available in java.util package. keySet()方法在java.util包中可用。 keySet() method is used to get a set of all the existing keys in this IdenityHashMap to be viewed in …

C#省市二級聯動(王者榮耀挑選英雄為例)

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;namespace beyond_聯動_ {public partial clas…

二叉排序樹(Binary Sort Tree) 又稱為二叉查找樹(Binary Search Tree) - (代碼、分析)

目錄&#xff1a;代碼&#xff1a;分析&#xff1a;代碼&#xff1a; BSTree.h #ifndef _BSTREE_H_ #define _BSTREE_H_typedef void BSTree;//定義二叉樹類型 typedef void BSKey;//定義節點的鍵值類型&#xff08;用于節點排序&#xff09;typedef struct _tag_BSTreeNode …

springboot tomcat默認線程數_記一次JAVA線程池的錯誤用法

最近項目一個項目要結項了&#xff0c;但客戶要求 TPS 能達到上千&#xff0c;而用我寫的代碼再怎么弄成只能達到 30 的 TPS&#xff0c;然后我又將代碼中能緩存的都緩存了&#xff0c;能拆分的也都拆分了&#xff0c;拆分時用的線程池來實現的&#xff1b;其實現的代碼主要為…

引以為鑒-ARM開發板連線注意事項

前些日子把實驗室的三臺機子放到一個工位上&#xff0c;非常擁擠&#xff0c;做實驗也很不方便。因此&#xff0c;想把ARM開發板的環境重新搭建到自己的電腦上。說完就做&#xff0c;上午就開始忙活起來。把開發板上的USB線、串口線、JTAT接口、還有電源線一一插好。接著就開始…