Page 114 - DCAP201_FUNDAMENTALS_OF_DATA_STRUCTURES
P. 114

Unit 7: Linked Lists




                                                                                                Notes
             2.  Insert
             3.  Delete
             4.  Exit

             Enter Your Choice : 2
             Enter the Data: 30
             Enter the Position: 1

              30
              10
             1.  Create
             2.  Insert
             3.  Delete

             4.  Exit
             Enter Your Choice: 3
             Enter the Position: 2

             List is Empty
             Question
             Write a program to create a linked list & display the elements in the list.

          Source: http://enggedu.com/lab_exercise/data_structure_lab/C_program_to_implement_single_
          linked_list.php

          7.3 Summary

               A linked list is a collection of objects linked together by references from one object to
               another object.
               We must begin from the head of the list and traverse the list sequentially to access the
               nodes in the list.
               A node is a struct with at least a data field and a reference to a node of the same type.

               A singly linked list consists of a number of nodes in which each node has a next pointer to
               the following element.
               A doubly linked list is a list that has two references, one to the next node and another to
               previous node.
               A multilinked list is a more general linked list with multiple links from nodes.

               A circular linked list is a list where last node of the list points back to the first node (or the
               head) of the list.

               A famous problem that uses a circularly linked list is the Josephus problem. This problem
               has to do with selective deletion from a circularly linked list.








                                           LOVELY PROFESSIONAL UNIVERSITY                                   107
   109   110   111   112   113   114   115   116   117   118   119