Thread: Link lists

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    46

    Link lists

    Im mostly a C person, can anyone explain these to me and maybe give an example?

  2. #2
    Registered User
    Join Date
    Jun 2002
    Posts
    82
    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

  3. #3
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    ...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;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I'm confused about link lists (again)
    By JFonseka in forum C Programming
    Replies: 4
    Last Post: 06-13-2008, 08:13 PM
  2. functions using link lists
    By chood72 in forum C++ Programming
    Replies: 3
    Last Post: 10-31-2005, 03:51 PM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  4. Link lists as datastructure
    By stseitli in forum C Programming
    Replies: 13
    Last Post: 07-09-2002, 07:34 AM
  5. double link lists
    By rumi_red in forum C++ Programming
    Replies: 3
    Last Post: 10-30-2001, 10:13 AM