Round Robin schedule (non-recursive), non-recursive round robin schedule

Source: Internet
Author: User

Round Robin schedule (non-recursive), non-recursive round robin schedule

# Include <iostream> # include <vector> # include <iterator> # include <algorithm> using namespace std;/** round robin schedule (non-recursive) */void Copy (int ** map, int sr, int sl, int dr, int dl, int k) {for (int I = 0; I <k; I ++) {for (int j = 0; j <k; j ++) {map [dr + I] [dl + j] = map [sr + I] [sl + j] ;}} void Table (int ** map, int k) {for (int I = 2; I <= k; I <= 1) {for (int j = 0; j <k; j + = I) {// Copy from the upper left corner to the lower right corner (map, 0, j, 0 + I/2, j + I/2, I/2 ); // Copy (map, 0, j + I/2, 0 + I/2, j, I/2) from the upper right corner; }}} int main () {int k; // enter the number of athletes. cin> k; int ** p = new int * [k]; // The Competition table is initialized for (int I = 0; I <k; I ++) {p [I] = new int [k]; p [0] [I] = I + 1; p [I] [0] = I + 1;} // run the function Table (p, k); // output the result cout <"Round Robin schedule (non-recursive ): "<endl; for (int I = 0; I <k; I ++) {copy (p [I], p [I] + k, ostream_iterator <int> (cout, ""); cout <endl;} return 0 ;}

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.