Skip to content

Instantly share code, notes, and snippets.

@krv
Created January 27, 2013 20:43
Show Gist options
  • Save krv/4650375 to your computer and use it in GitHub Desktop.
Save krv/4650375 to your computer and use it in GitHub Desktop.
fropple
public void fropple() {
ListElement d = head;
int i = (getSize() % 2 == 0) ? getSize() : getSize() - 1;
while (i > 1) {
if (i-- % 2 == 0) {
Object temp = d.getFirst();
d.setValue(d.getNext().getFirst());
d.getNext().setValue(temp);
}
d = d.getNext();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment