上一页 1 2 3 4 5 6 7 ··· 16 下一页
摘要: 在项目中将MongoDB服务封装成服务类,并实现具体增删改查方法。在此记录一下(思路如下,具体实现还需依具体开发场景而定)。 import numpy as np import pymongo class Mongo: port = 27017 host = 'localhost' client = 阅读全文
posted @ 2022-06-01 14:24 沃特艾文儿 阅读(33) 评论(0) 推荐(0)
摘要: 选择排序 // // Created by 29273 on 2022-03-16. // #include "bits/stdc++.h" using namespace std; int n; int a[100]; void selectSort() { for (int i = 1; i < 阅读全文
posted @ 2022-03-16 16:12 沃特艾文儿 阅读(21) 评论(0) 推荐(0)
摘要: 冒泡排序 // // Created by 29273 on 2022-03-16. // #include "bits/stdc++.h" using namespace std; int a[100]; int n; void bubbleSort() { int flag; for (int 阅读全文
posted @ 2022-03-16 15:54 沃特艾文儿 阅读(49) 评论(0) 推荐(0)
摘要: 二分查找模板 // // Created by 29273 on 2022-03-16. // #include "bits/stdc++.h" using namespace std; int n,x; int a[100]; int binarySearch(int x) { int low = 阅读全文
posted @ 2022-03-16 15:29 沃特艾文儿 阅读(13) 评论(0) 推荐(0)
摘要: 仅作记录,拓扑模板 // // Created by 29273 on 2022-03-16. // #include "bits/stdc++.h" using namespace std; const int maxN = 1e4 + 10; vector<int> V[maxN]; vecto 阅读全文
posted @ 2022-03-16 15:02 沃特艾文儿 阅读(22) 评论(0) 推荐(0)
摘要: 最短路prim算法模板,仅作记录 // // Created by 29273 on 2022-02-23. // Prim 最短路径算法模板 #include<iostream> #include "bits/stdc++.h" using namespace std; const int max 阅读全文
posted @ 2022-03-16 11:09 沃特艾文儿 阅读(30) 评论(0) 推荐(0)
摘要: dijkstra 模板 需要对其进行改造 100 = value * 汇率 1 * 汇率2 * 。。。 那么汇率乘积越大越好 最短路便可改造为为最长路; dis 初始化为 0 d 数组初始化为 0(最短路均初始化为inf) 松弛条件判定改变 if (!vis[j] && dis[j] < dis[u 阅读全文
posted @ 2022-03-12 21:53 沃特艾文儿 阅读(17) 评论(0) 推荐(0)
摘要: 对于已经连接的路距离设为零,断开的道路保持原先的距离跑一遍dijkstra 或者spfa 。 // // Created by 29273 on 2022-03-01. // #include "bits/stdc++.h" using namespace std; #define inf 0x3f 阅读全文
posted @ 2022-03-10 20:41 沃特艾文儿 阅读(20) 评论(0) 推荐(0)
摘要: 简单dfs 对于每一个不为‘0’且未被访问的地方开始dfs搜索,将其连通不为‘0’的地方vis数组置为0(之后无需访问访问),ans++。 // // Created by 29273 on 2022-03-09. // #include "bits/stdc++.h" using namespac 阅读全文
posted @ 2022-03-10 15:58 沃特艾文儿 阅读(32) 评论(0) 推荐(0)
摘要: 记录一下求解代码 思路 并查集作为工具,每次输入新的一组数据时将所有辅助空间重置menton数组,minX,maxX来记录输入数据的最大值,最小值以及输入过的数据,因为数据输入并不是从一开始也不是n-m连续的对于每一组数据 输入的每一对数据,先检验是否二者father是否相同,相同说明已经连通,再联 阅读全文
posted @ 2022-03-10 15:52 沃特艾文儿 阅读(32) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 16 下一页