Java List Sort mergeLong(List l1, List l2, boolean sort)

Here you can find the source of mergeLong(List l1, List l2, boolean sort)

Description

merge Long

License

Open Source License

Declaration

public static List<Long> mergeLong(List<Long> l1, List<Long> l2, boolean sort) 

Method Source Code

//package com.java2s;
/*//from ww w  . ja v  a 2s . co  m
 * Copyright (C) ${year} Omry Yadan <${email}>
 * All rights reserved.
 *
 * See https://github.com/omry/banana/blob/master/BSD-LICENSE for licensing information
 */

import java.util.*;

public class Main {
    public static List<Long> mergeLong(List<Long> l1, List<Long> l2, boolean sort) {
        Set<Long> set = new HashSet<Long>(l1);
        set.addAll(l2);
        List<Long> res = new ArrayList<Long>(set);
        if (sort) {
            Collections.sort(res);
        }
        return res;
    }
}

Related

  1. isStringListSortedDesc(List list)
  2. isUnsortedEventsMatch(List actual, List expected)
  3. ListToSortedArray(List list)
  4. mapTosortedScoreList(HashMap unSortedMap)
  5. maximum(List sortedDataAscendingOrder)
  6. mergeSort(List m)
  7. mergeSort(List list)
  8. mergeSortedLists(List dest, List[] src, boolean removeDuplicates)
  9. quickSort(Comparable[] list, int min, int max)