Skip to content

Instantly share code, notes, and snippets.

View dangnhdev's full-sized avatar

Nguyễn Hải Đăng dangnhdev

  • Hanoi, Vietnam
View GitHub Profile
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org;
import java.util.LinkedList;
import java.util.Queue;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org;
import java.util.LinkedList;
import java.util.Queue;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org;
import java.util.LinkedList;
import java.util.Queue;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org;
import java.util.LinkedList;
import java.util.Queue;
package org;
import java.util.LinkedList;
import java.util.Queue;
public class Queues {
public static <E> Queue<E> split(Queue<E> queue) {
Queue<E> myQueue = new LinkedList<>();
if (queue.isEmpty()) {
return myQueue;
import java.util.*;
public class SetListPerformanceTest {
static final int N = 50000;
public static void main(String[] args) {
// Add numbers 0, 1, 2, ..., N - 1 to the array list
List<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < N; i++)
list.add(i);
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.common.AppLogger;
import org.processor.DataFilter;
import org.processor.FileReader;
import org.processor.FileWriter;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.processor;
import org.common.AppLogger;
import java.io.BufferedWriter;
import java.io.File;
public enum Planet {
MERCURY (3.303e+23, 2.4397e6),
VENUS (4.869e+24, 6.0518e6),
EARTH (5.976e+24, 6.37814e6),
MARS (6.421e+23, 3.3972e6),
JUPITER (1.9e+27, 7.1492e7),
SATURN (5.688e+26, 6.0268e7),
URANUS (8.686e+25, 2.5559e7),
NEPTUNE (1.024e+26, 2.4746e7);
public enum Planet {
MERCURY (3.303e+23, 2.4397e6),
VENUS (4.869e+24, 6.0518e6),
EARTH (5.976e+24, 6.37814e6),
MARS (6.421e+23, 3.3972e6),
JUPITER (1.9e+27, 7.1492e7),
SATURN (5.688e+26, 6.0268e7),
URANUS (8.686e+25, 2.5559e7),
NEPTUNE (1.024e+26, 2.4746e7);