1
Fork 0

new post: swap in double-linked lists

This commit is contained in:
Jan-Erik Rediger 2012-05-07 22:31:24 +02:00
parent 78d6680a68
commit 0adc0909da

View file

@ -0,0 +1,16 @@
---
layout: post
title: swap in double-linked lists
date: 07.05.2012 22:22
---
Yesterday I had to implement [Selection Sort](http://en.wikipedia.org/wiki/Selection_sort)
for double-linked lists and I had some trouble finding the correct solution
when it comes to swapping two elements.
But I finally figured out how to correctly swap the pointers and I'll drop the
code here so others can use it (or even tell me about hidden bugs)
I implemented it in Java, so see here:
<script src="https://gist.github.com/2630183.js"> </script>