Skip to content

Instantly share code, notes, and snippets.

View hailpam's full-sized avatar
🎯
Focusing on my next thing...

Paolo Maresca hailpam

🎯
Focusing on my next thing...
View GitHub Profile
@hailpam
hailpam / NumericSetsMerger.py
Created February 20, 2016 11:27
Given a List of numeric Sets, it produces a new List of merged numeric Sets: overlaps in the intersections are detected, and the corresponding Sets are merged into a single non-overlapping Set. The working assumption is: sorted List of sorted numeric Sets (ascending order).
__author__ = "Paolo Maresca <plo.maresca@gmail.com"
DEBUG = True
def merge(sets):
"""
Merges together intersecting sets of numbers. The working assumption is: list of sets, and sets
@hailpam
hailpam / UnsortedLinkedListTest.java
Created November 7, 2015 12:41
Suite of automated tests for the Unsorted implementation of the LinkedList ADT.
package it.pm.algorithms;
import it.pm.algorithms.impl.UnsortedLinkedList;
import java.util.Random;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@hailpam
hailpam / UnsortedLinkedList.java
Created November 7, 2015 12:40
Unsorted implementation of the LinkedList ADT interface.
package it.pm.algorithms.impl;
import it.pm.algorithms.LinkedList;
/**
* Implementation of the {@link LinkedList} abstract class as unsorted list.
*
* @param <T>
* Type to use for Nodes' values
@hailpam
hailpam / LikedList.java
Created November 7, 2015 12:39
Abstract Generic Class defining the LinkedList ADT interface.
package it.pm.algorithms;
/**
* Abstract class defining a linked list interface.
*
* @param <T>
* Type to use for Nodes' values
*
* @author Paolo Maresca <plo.maresca@gmail.com>
@hailpam
hailpam / GeoLocatedFiltering.java
Created September 27, 2015 23:19
Filter out Customers based on their geo-location. The output is a collection of Customers ordered by their own Id - ascending order.
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.List;
import java.util.Objects;
@hailpam
hailpam / NestedArraysFlattener.java
Created September 27, 2015 23:16
Flatten any nested array of arrays into an Integer array.
import java.util.Arrays;
import java.util.List;
/**
* Nested Arrays Flattener runnable program.
*
* @author Paolo Maresca {@email plo.maresca@gmail.com }
*/
public class NestedArraysFlattener