Class MapUtil

java.lang.Object
org.drip.service.common.MapUtil

public class MapUtil
extends java.lang.Object
Author:
Lakshmi Krishnamurthy
  • Constructor Summary

    Constructors
    Constructor Description
    MapUtil()  
  • Method Summary

    Modifier and Type Method Description
    static 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.
    static int LeastIntervalTaskScheduler​(char[] taskArray, int coolOffInterval)
    Identify the Least Interval Task Scheduler
    static void main​(java.lang.String[] argumentArray)
    Entry Point
    static 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 - Numerator
      denominator - 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 Tasks
      coolOffInterval - 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
    • main

      public static final void main​(java.lang.String[] argumentArray) throws java.lang.Exception
      Entry Point
      Parameters:
      argumentArray - The Argument Array
      Throws:
      java.lang.Exception - The Exception Encountered