摘要:
示例无向图如下:(起始点为v0) 邻接矩阵为: 注意:其中没有连接的边和自己到自己的点权值用10000表示。 代码: 结果 解析: 分三部分,主函数中给出图中的初始邻接矩阵,顶点个数。以及初始化最短路径的顶点集合和点路线集合。 IsContain(int m,int[] S)这个函数是在每次循环的时 阅读全文
摘要:
26、Remove Duplicates from Sorted Array Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return th 阅读全文
摘要:
21、 Merge Two Sorted Lists Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of th 阅读全文