Skip to main content
Code Review

Timeline for Greedy Algorithm - Tuple Comparator

Current License: CC BY-SA 3.0

6 events
when toggle format what by license comment
Oct 19, 2017 at 15:19 comment added Teddy just edited the code to include everything + example. The subjects.txt file is a text file with course name, value, work separated by a space with 1 course per line.
Oct 19, 2017 at 12:27 comment added Ludisposed I'm sorry, but this is not enough: What is subjects it be best if you update your question with a full working example
Oct 18, 2017 at 15:03 comment added Teddy cmpValue Example: input: print greedyAdvisor(subjects, 7, cmpValue) | output: {'6.00': (10, 1), '6.18': (10, 4), '6.04': (1, 2)} cmpWork Example input: print greedyAdvisor(subjects, 7, cmpWork) | output: {'6.00': (10, 1), '6.12': (6, 3), '6.04': (1, 2)}
Oct 17, 2017 at 7:20 comment added Ludisposed @Teddy Maybe if you'd add an example with what input your code would be run. I could give a better answer.
Oct 17, 2017 at 4:31 comment added Teddy Thanks for the feedback. How would I use the comparator function within the greedAdvisor? Right now as my code is the comparators are useless as they are not invoked at all. Instead I am using an If statement as a workaround. N.B: Subjects is a dictionary containing value as follow: subject {‘course’:(Value, Work)}
Oct 16, 2017 at 7:47 history answered Ludisposed CC BY-SA 3.0

AltStyle によって変換されたページ (->オリジナル) /