Saturday, August 13, 2011

How to display a random string from a linked list in C++?

random access with lists is really tough. how would you do this when you can't access a single element at random as with arrays (ie node[5])? In java ( and maybe c++ ) the collections libraries ( for vectors and the like ) have a shuffle() method that swaps around the nodes "randomly" but I'd have to guess this is a really complex operation and also very very slow. Then again im no expert so hopefully someone else can give you a concise answer on this.

No comments:

Post a Comment