Suite101
Post this Blog to facebook Add this Blog to del.icio.us! Digg this Blog furl this Blog Add this Blog to Reddit Add this Blog to Technorati Add this Blog to Newsvine Add this Blog to Windows Live Add this Blog to Yahoo Add this Blog to StumbleUpon Add this Blog to BlinkLists Add this Blog to Spurl Add this Blog to Google Add this Blog to Ask Add this Blog to Squidoo

May 29, 2007

Swap Till You Drop

In creating some tutorial style articles for the site, I checked some of the most popular search terms, and a few kept coming back - searching, sorting, swapping and linked lists. So, I thought I'd gather together some existing wisdom for you, while I prepare the definitive guide to sorting linked lists.

First off, two ways to sort a C++ linked list. We look at an insertion sort, and how it can be used, as well as a couple of alternatives, along with some advice on which one to choose. More concentrated information on sorting you will not find:

Two Ways to Sort a C++ Linked List

For those not scared of a bubble sort tutorial, the Alphabetizing article is a great place to start:

Alphabetizing a Linked List in C

It actually occurred to me after re-reading this one, that there is a much better way to do it. If you've read it, then you'll spot immediately what that is, and it revolves around maintaining several lists of sorted data, based on the same starting letter or letters.

That's enough hints.

Then, there are a couple of swapping articles, for those having issues with understanding a three step swap:

Program for Swapping Integers in C

Swapping Techniques in C Programming

And, as usual, there are more in the works. Requests to me, please - computerprogramming(at)suite101(dot)com.

Happy Swap/Search/Sorting!