Class MergeOrderedLists


  • public class MergeOrderedLists
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T extends java.lang.Comparable<T>>
      java.util.List<T>
      merge​(java.util.List<T> iList0, java.util.List<T> iList1)
      merge takes two already ordered lists and merges them into one ordered list in N time.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MergeOrderedLists

        public MergeOrderedLists()
    • Method Detail

      • merge

        public static <T extends java.lang.Comparable<T>> java.util.List<T> merge​(java.util.List<T> iList0,
                                                                                  java.util.List<T> iList1)
        merge takes two already ordered lists and merges them into one ordered list in N time. If input lists are null, then no merge is needed. If both lists are null an empty list is returned. If the input lists are not ordered, then unpredictable results are returned.
        Type Parameters:
        T -
        Parameters:
        iList0 -
        iList1 -
        Returns: