Friday, 19 April 2013

Single Linked List


Singly-linked lists



singly-linked-list




  Here is a singly linked list (SLL):

 Each node contains a value and a link to its successor (the last node has no successor)
 The header points to the first node in the list (or contains the null link if the list is empty)



Creating a simple list



    To create the list ("one," "two," "three"):


 Cell numerals = new Cell();
   numerals =
    new Cell("one",
        new Cell("two",
            new Cell("three", null)));
 

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More