Skip to content

Instantly share code, notes, and snippets.

View sangupta's full-sized avatar
💭
I may be slow to respond.

Sandeep Gupta sangupta

💭
I may be slow to respond.
View GitHub Profile
@sangupta
sangupta / gist:2993291
Created June 26, 2012 04:30
Code to determine overlaps in set of data ranges
/**
Problem: Given a set of data ranges (i.e. 2-7, 5-9, 10-20), write a function to determine if there is any overlap within the set.
Write test cases. Which data structure would be best to represent the intervals.
Solution: I would prefer to use an array of size 2N and then iterate over it. Another
way is to work up using interval tree's but I think that may be an overkill considering
it used to check overlaps in multiple ranges and points.
*/
@sangupta
sangupta / org.eclipse.egit.github.core.RepositoryCommit.java
Created November 10, 2011 16:44
Class to hold the statistics as returned by the GitHub Commit API for single commit details.
/**
Add the following lines to the original class:
org.eclipse.egit.github.core.RepositoryCommit.java
*/
private Stats stats;
private List<CommitFile> files;
public Stats getStats() {