Skip to content

Instantly share code, notes, and snippets.

@lucasrangit
lucasrangit / CircularArray.java
Last active August 29, 2015 14:24
A generic CircularArray class that can be efficiently rotated and is iterable.
/*
* A generic CircularArray class that can be efficiently rotated and is
* iterable.
*/
import java.util.Iterator;
public class CircularArray implements Iterable<Object> {
private Object[] a;
private int r;