Create a scheduling algorithm for a central SQL server that responds to database queries from many different clients. The queries can only be run one at a time, but can be run in any order. We know in advance what the queries are and what their running times will be.
We want to choose how to schedule query such that the overall waiting time is minimized. The *waiting time* of a query is how long it must wait in a queue before it is executed.
For example, if the running times of the queries are (2, 5, 1, 3) and we schedule the queries in that order, then the total waiting time is 0 + (2) + (2+5) + (2+5+1) = 17. If we scheduled them in the reverse order, then the total waiting time is 0 + (3) + (1+3) + (5+1+3) = 16, which is slightly better. However, the minimum possible waiting time for this example is 10.
Implement the function scheduling(times), which is given a list of query times and returns the optimal (minimum) total waiting time.
scheduling([2, 5, 1, 3]) # 10
scheduling([3, 4, 4, 4, 4, 2]) # 46
scheduling([3, 1, 4, 3]) # 12
scheduling([7, 3, 7, 3, 3, 1]) # 39
scheduling([2, 6, 2, 6, 3, 6]) # 45
And use this to start the code:
Hi, Nice to meet you! I have read your requirements carefully and I am very interesting for your project. I am confident of this project as I'm a professional Python expert with over 5 years of experience. [login to view URL] Plus
11 freelance font une offre moyenne de $69 pour ce travail
Hello, this is a kind of optimization task. It will require to test all (n!) permutations or use a kind of optimization algorithm say Branch and Bound method or Genetic algorithms. The last algorithms is only check the Plus
I have read your project and I am an expert in this field. I can do this for you within due time and honestly. I also have a few questions to discuss. Kindly contact me and we will discuss time and budget. Thanks
Hello! I'd like to help you with this theory of algorithms assignment! I'm familiar with various data structures as well search ones. I can do the job blazingly fast. Please, give me a try!
I know how to implement described solution. You could accept me and i will share my expertise with you. About me: Senior SQL Developer with 10+ years experience, worked during this time with several automation system Plus
I have read your project description and I am interested in the project. As you can see my profile, I am a full-time developer and have just completed many projects. Specially, I have wide experience in C/C++, C#, Plus
Hello sir, i can complete this function very easily within 30 minutes. It will return minimum required time, giving waiting time for all the schedule. drop a message and lets discuss about it
I am a python developer with 3 year experience. I make a point to write my code in a consistent style adhering to the PEP8 style document. Reply me as soon as possible so we can discuss further details. Thank you!
I had BSc and MSc degree in Applied Mathematics and Informatics (gpa 4.8). Also undertaken postgraduate studies in Information and Navigation Systems (PhD candidate). I had solid experience in Python, C backgrounding b Plus
Hello customer. I understood all details of your project. I have enough experience about optimization such as your project. As you can see, I am C, Python and C++ language expert. I think that it requires high algorith Plus