Im mostly a C person, can anyone explain these to me and maybe give an example?
Im mostly a C person, can anyone explain these to me and maybe give an example?
A linked list can be thought of as a train; you have a series of cars that all link together the same way, while in a linked list you have a series of "nodes", which can be thought of as a box with two pointers: one to a variable of arbitrary type, and the other to another node. The cars can contain anything you want; in an ideal linked list, each "node" can contain anything you want (string, int, Widget, etc.). You can separate two cars and insert another in between them; you can insert a new node in the middle of a linked list without disturbing the rest too much. You can search your train one car at a time until you find what you're looking for, same with the linked list. The train ends with a caboose; the last node has its "next" pointer set to null.
A good reference for these (and other data structures), as I just placed in another post (deja vu) is
http://www.brpreiss.com/books/opus4/html/book.html
Last edited by geophyzzer; 12-11-2002 at 02:09 PM.
Claus Hetzer
Compiler: Borland 5.5 (on Windows)
Solaris CC (on Unix)
Known Languages: C++, MATLAB, Perl, Java
...or just click the search button at the top of this page. There have been a whole lot of posts on this topic.
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }