I have a algorithm problem to ask:
There are N persons, and each of them knows one distinct gossip message. The two of them just make a phone call, so they could share messages they know. Then at least how many phone calls do they need make , so that each of them knows all the N messages?
alien2006.happy
0
Newbie Poster
Recommended Answers
Jump to PostHey there,
As with almost any algorithm, you want to define a base case. Also you want to have at least one testable condition, and then you need at least one exit condition. So . . . your exit condition will be :for all N: what …
All 2 Replies
Reply to this topic
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.