Package org.drip.service.common
Class MapUtil
java.lang.Object
org.drip.service.common.MapUtil
public class MapUtil
extends java.lang.Object
MapUtil implements Utility Functions based on Maps. It implements the following Functions:
- Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating, enclose the repeating part in parentheses
- Identify the Least Interval Task Scheduler
- There are
Npeople. We have information about interests of each person. The task is to find minimum set of groups that these people can be placed into so there are no any 2 persons who share the same interests in one particular group. Each person can have infinitely large number of interests
- Author:
- Lakshmi Krishnamurthy
-
Constructor Summary
Constructors Constructor Description MapUtil() -
Method Summary
Modifier and Type Method Description static java.lang.StringFractionToDecimal(int numerator, int denominator)Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.static intLeastIntervalTaskScheduler(char[] taskArray, int coolOffInterval)Identify the Least Interval Task Schedulerstatic java.util.Collection<java.util.Set<java.lang.String>>MinimumSetOfGroups(java.util.Map<java.lang.String,java.util.Set<java.lang.String>> personInterestSetMap)There are N people.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
MapUtil
public MapUtil()
-
-
Method Details
-
FractionToDecimal
public static final java.lang.String FractionToDecimal(int numerator, int denominator)Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating, enclose the repeating part in parentheses.- Parameters:
numerator- Numeratordenominator- Denominator- Returns:
- The Fraction in String Format
-
LeastIntervalTaskScheduler
public static final int LeastIntervalTaskScheduler(char[] taskArray, int coolOffInterval)Identify the Least Interval Task Scheduler- Parameters:
taskArray- The Array of TaskscoolOffInterval- The Minimum Cool-off Interval- Returns:
- Least Interval Task Scheduler
-
MinimumSetOfGroups
public static final java.util.Collection<java.util.Set<java.lang.String>> MinimumSetOfGroups(java.util.Map<java.lang.String,java.util.Set<java.lang.String>> personInterestSetMap)There are N people. We have information about interests of each person. The task is to find minimum set of groups that these people can be placed into so there are no any 2 persons who share the same interests in one particular group. Each person can have infinitely large number of interests.- Parameters:
personInterestSetMap- The Person Interest Set Map- Returns:
- Minimum Set of Groups
-