Find water King-class homework

Source: Internet
Author: User

Program code

Results

Experimental summary

Because the water king is the entire forum post and the number of replies to add up the person, and more than half of the total number of posts. (Here the number of posts and replies are recorded together) using the "22 phase elimination" method. The author ID of the post is included in the array, and a number in the array is credited as the suspected water king, and the number of posts t=0. Iterate through the array, if the number in the array and the suspected water King ID is the same, so that the number of posts T plus one. If it is different from the suspected water King ID, make the post number T minus one. When t=0, the number of the array currently compared with the water king suspect as the new suspected water king. The end of the cycle, the current water king suspect is the water king.

Find water King-class homework

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.