1
0
watching
122
views 14 May 2018

# 33. Base10 is the set of numbers created from the digits {0,1,2,3,4,5,6,7,8,9}. Whereas base2, which is the set of numbers created with {0,1}. We could similarly define base; as the ordered set of characters created from {X,Y,Z}. What is the following basez number, Yxz, in base ? Random graph For this section you will need to look at the classes Graph and GraphNode present in the appendix. A Graph consists of a number of nodes, each of which has connections to other nodes in the graph. You can think of nodes as a representation of a person in a social network (e.g. Facebook). The ArrayList connectedTo variable in GraphNodes is the list of friends that particular person has. For example, in the following graph, the node O is friends with node 1 and 2. On the other hand, node 2 and node 1 are not friends, hence the lack of link. 0-0 In the constructor of the Graph, the process of connecting nodes is randomized. Moreover, we will not allow a node to be connected to itself and we are going to assume that the arguments passed to the Graph constructor respect the following conditions: n > 2, and n > nbConnections. Pay close attention to the character order 