Results 1 to 9 of 9

Thread: Linked Lists

  1. #1

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Linked Lists

    I have heard about Linked List forever and a day now and still don't know rightly what they are or how they are effiecent....

    Would someone clue me in....
    Magiaus

    If I helped give me some points.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Linked Lists

    Look here, I explain the idea of linked lists a bit down the discussion.

    Linked lists offer fast linear traversal, constant-time insertion and deletion at any known point in the sequence, but a lack of random access. Also, you have to decide whether you want splicing or the length query in constant time, the other one will be linear time. Sorting is O(n²) because of the lack of random access, and binary search is not possible, so that searching will always be linear.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Re: Linked Lists

    Ok, my c/c++ isn't anywhere at the working level of writing a memory pool, but I think I understand the bascic linked list concept a little better now.

    How would you implement a linked list in C#?

    Keep in mind that I started programming in vb3 and my perceptions are warpped.... the last time I was considering writing a fast key/value or indexed strong typed collection in C# I looked at basing it on the System.Collections.Stack; didn't feel learning how to write push/pop code was worth the time so I used ArrayList by default...

    A short answer will do for my second question. Can you think of any situation where I would actual want to break off into unmaged code and manage my own memory/memory pool in C# where I wouldn't be better off making a C++ Managed assembly/namespace.



    Are you a student or a teacher at your university and what univirsty? I ask because I have I low opinion of the level of education of collage the educated programmers(at least in my area/experiance) and it sounds like you univirsty is providing the needed classes if the student cares to take them. That statement can be interpreted as meaning a very large percentage of the collage educated programmers I have worked with I have problem with thinking outside the box or this is what they taught me in school and this is what I do.....

    One more since I am bombarding you... Is that you I see on the daily ***..?
    Last edited by Magiaus; Jul 2nd, 2005 at 09:04 AM.
    Magiaus

    If I helped give me some points.

  4. #4

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Re: Linked Lists

    *** the forum changed my post lol....
    Magiaus

    If I helped give me some points.

  5. #5

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Re: Linked Lists

    not to spam my thread but *** == w t f

    dang ol short hand not the @#$% allowed
    Magiaus

    If I helped give me some points.

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Linked Lists



    I'm a student. I do my thinking outside the box - outside the university. Indeed, one of my younger professors complained about the lack of independent thinking in the students, but that's a problem of the system, not of the individual courses.

    The situations in managed code when you'd want to use your own memory management are the same as in unmanaged code: when profiling reveals that you're spending too much time allocating objects. However, I believe that the allocator of .Net, having more information at runtime than just the number of requested bytes, is somewhat more efficient than most C++ allocators.
    I can't think of any situation where you'd use unmanaged code to do this management, though. You'd just request a large block of memory in managed code and deal it out bit by bit.

    I once wrote a C# LinkedList class. I'll upload it. I have no idea of the actual quality of the code though. It's been a while.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  7. #7
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Linked Lists

    OK, here's the file. I realized that this class is quite incomplete. For example, it doesn't let you insert elements at arbitrary positions. Well, left as an exercise to the reader
    Attached Files Attached Files
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  8. #8

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Re: Linked Lists

    Thanks for the sample; I'll check it out.

    I actually thought you would say teacher/professor. I mean you seem to know something about almost everything. Are you going for Computer Engeniring or something else?
    Magiaus

    If I helped give me some points.

  9. #9
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Linked Lists

    My particular study target is called "Software & Information Engineering", but most of my knowledge comes from private curiosity.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width