6 kyu

Operating System Scheduling #1 : FCFS scheduling

66 of 87G_kuldeep
Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • B1ts Avatar

    What happened to the rest of this series? :(

  • eurydice5717 Avatar

    Could be e great kata... but for those rounding sh...

  • MikChan Avatar

    C++ fork that handles this and this issues.

    • Tests are now truly random.
    • The comparasion now happens with delta.
    • Added missing headers.

    Please, review and reject/accept.

  • MikChan Avatar

    Return Average Completion Time, Average Turn Around Time, Average Waiting Time and Throughput in vector (A-CT, A-TAT, A-WT, Throughput) all rounded to two decimal places.

    While solving in C++ I (and, I believe, a lot of other solvers) had a problem with rounded to two decimal places part. It practically turns the kata into the guessing game. A problem is that the way you do that may change the result, and since this kata uses Assert::That(..., Equals(...)) for comparing doubles it actually creates a huge obstacle. E.g.

    const double n = 689;
    const int size = 5;
    
    const double r1 = std::round(n / size * 100) / 100; // -> 137.8
    const double r2 = std::ceil(n / size * 100) / 100; // -> 137.81 (btw before this issue is resolved, this is the way you're supposed to do that) 
    const double r3 = std::ceil(n  * 100 / size) / 100; // -> 137.8
    

    Something should probably done with this, because it makes such a good kata practically unsolvable if you're unlucky enough.

  • MikChan Avatar

    In C++ random tests are not random at all. Please, check this out -> https://docs.codewars.com/languages/cpp/authoring#random-utilities

  • 7097511 Avatar

    C ++ language. In a random test with data {{11, 69}, {62, 24}, {67, 30}, {68, 36}, {82, 31}}: Expected: equal to [ 137.81, 79.8, 41.8, 38 ] Actual: [ 137.8, 79.8, 41.8, 38 ].

    But 689 / 5 = 137.80.

  • user1380056 Avatar

    This is the best kata I have ever seen here.

  • Harleigh Avatar

    Well written Kata and great concept G_kuldeep! I am looking forwards to the rest of the series!

  • SirSkylord Avatar

    Hey G_kuldeep, this Kata is awesome! I was just studying scheduling algorithms when I stumbled upon this Kata, great timing.

    My only feedback is to clean up the description a little. There are some semi-colons instead of apostophes for a word or two, and there were a few misspellings.

    But seriously, great kata, I bookmarked it! Are you going to add new ones in the series?! I am excited!

  • user7820265 Avatar

    This comment has been hidden.

  • Blind4Basics Avatar

    This comment has been hidden.