Suppose I had a network of switches, or more generally, Nodes. Each Node has a method getNeighbors(), which returns a set of adjacent Nodes in the network. Write a function findNeighborhood(Node, n) which given a Node and int n returns all nodes no more than n hops away... I want the solution in java or C++ or in an algorithm form

Suppose you read the Member Rules.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.