What do you want to save?
Add Code snippet
New code examples
-
C++ 2022-03-27 12:15:21
find the graph is minimal spanig tree or not
#include <iostream> #include <vector> #include <utility> #include <algorithm> using namespace std; const int MAX = 1e4 + 5; int id[MAX], nodes, edges; pair <long long, pair<int, int> > p[MAX]; void initialize() { ... Add solution -
Other 2022-03-27 06:20:45
90-Percentile effective diameter
import snap Graph = snap.GenRndGnm(snap.TNGraph, 100, 1000) NTestNodes = 10 IsDir = False EffDiam = Graph.GetBfsEffDiam(NTestNodes, IsDir) print(EffDiam) UGraph = snap.GenRndGnm(snap.TUNGraph, 100, 1000) NTestNodes = 10 IsDir = False EffDiam = UGraph.Ge... Add solution -
Javascript 2022-03-20 05:45:24
what does sanitize do javascript
// our input string to clean const stringToClean = 'Some text <b><i>with</i></b> <blink>tags</blink>, including a rogue script <script>alert(1)</script> def.'; const result = new Sanitizer().sanitize(string... Add solution -
Python 2022-03-17 07:50:19
Highlighting the shortest path in a Networkx graph
import matplotlib.pyplot as plt G = nx.karate_club_graph() pos = nx.spring_layout(G) nx.draw(G,pos,node_color='k') # draw path in red path = nx.shortest_path(G,source=14,target=16) path_edges = zip(path,path[1:]) nx.draw_networkx_nodes(G,pos,nodelist=path... Add solution -
C++ 2022-03-15 06:55:06
segment tree complexity
// C++ program to show segment tree operations like construction, query // and update #include <bits/stdc++.h> using namespace std; // A utility function to get the middle index from corner indexes. int getMid(int s, int e) { return s + (e -s)... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5