The Erdős number describes the minimum “collaborative distan…

The Erdős number describes the minimum “collaborative distance” between mathematician Paul Erdős and another person, as measured by authorship of mathematical papers. We can represent a scientific network of collaborations using a graph, G in which each person denotes a  a vertex and an edge represents if two scientists have worked on a paper together. Write a function that takes in as input the source scientific network graph, G and a scientist, S and returns the calculated Erdős number (the minimum path length from Paul Erdős to S). Return -1 if there is no path between the scientist, S and Paul Erdős. Write the function using C++ syntax or pseudocode (with minimal prose). [10 points] You can assume  Paul Erdős is already a node in the graph. Graph G (V,E) is pre-built and is an unweighted graph represented as an adjacency list or matrix.

Construct a Huffman tree for a file that contains a single s…

Construct a Huffman tree for a file that contains a single string “abbcccc”. Assume the node with a lower priority is attached to the left of the parent node in case two nodes are merged after extraction from the priority queue; traversing left from a node appends ‘0’ to the Huffman code and traversing right appends ‘1’.  What are the Huffman codes for: character ‘a’ : [a] character ‘b’ : [b] character ‘c’ : [c]