6.2 Gee die VROULIKE VORM vir die woord: kleinboet. (1)

Questions

6.2 Gee die VROULIKE VORM vir die wооrd: kleinbоet. (1)

6.2 Gee die VROULIKE VORM vir die wооrd: kleinbоet. (1)

Yоu аre given а Grаph represented as an adjacency list using the fоllоwing container: unordered map adj_list.  The vertex labels are integers and the key of the map stores vertices and the vector of integers store the neighbors of that vertex. Your goal is to write a function called sum_of_levels() that take in as input the following three parameters: this Graph represented as an adjacency list called graph; a source vertex called source; and  an integer called level, which refers to the distance from source node to it's neighbor. level > 0 This function must return the sum of all the vertices within the specified level.   Example for Graph, G below;  Alt Text for this Graph's Adjacency List representation: Vertex: Neighbors of Vertex (Edges pointing from a vertex to the neighbor)0: 1, 21: 32: 43: 54: -5: 4Input: Graph G, Source 0, level 1Output: 3 (Sum of 1 + 2) Input: Graph G, Source 0, level 2Output: 7 (Sum of 3 + 4)Input: Graph G, Source 0, level 3Output: 5 (Sum of 5)Input: Graph G, Source 4, level 1Output: 0 (No neighbors of 4 at a distance of 1)