MCPcopy Create free account
hub / github.com/Ainevsia/Leetcode-Rust / getchildn

Method getchildn

Weekly Contest 179/p4/Solution.cpp:20–27  ·  view source on GitHub ↗

get the number of childs of the node id */

Source from the content-addressed store, hash-verified

18public:
19 /* get the number of childs of the node id */
20 int getchildn(int id) {
21 for (vector<int>::iterator it = ut[id].begin(); it < ut[id].end(); ) {
22 if (visited[*it]) ut[id].erase(it);
23 else it ++ ;
24 }
25 visited[id] = true;
26 return ut[id].size();
27 }
28
29 // p -> possibility to reach this node `id`
30 void dfs(int id, double p, int round_left) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected