Talk:Data Structures/LinkedLists

Actually you *can* do that (in C99 at least)

You use a linked list (instead of a memory allocated array) when you need fast element deletions and insertions at any place in the data sequence, but do not require fast random access. You could use a different data structure, like a heap to do the same thing. But a list is simpler to program. A heap only is significantly better when your data is ordered and you need quicker random access.


 * Good point. Perhaps the emphasis should be placed on being able to insert items in the middle versus just the end, or as a way of chaining already allocated objects together. I have to say, with automatic realloc features being common in languages, as with pointers (instead of the field values themselves) it makes more sense to use vectors than the linked lists we all used in the C days. Mshonle

LINKED LIST
LINKED LIST:-linked is a chain of object.it is dynamic data structure.there are three types of data structure 1.singly linked list:- each node contain the next node and last node contain NULL value and the address of the first node held start pointer. 2.doubly linked list:- each node contains the address of next node as well as the address previous node and address of the next field of the last node contain NULL and address of the previous field of the first node also contain NULL. 3.circular linked list:- each node containing the address of next node but last node contain the first node. (1)insertion: -beg -between -last (2)traversing (3)searching (4)deletion: -beg -between -last [1]. make current node point to the first node in the list. [2]. repeat the step 3 and 4 until current node become NULL. [3]. display the information contained in the node MARKED as current node. [4]. make current node to the next in the sequence. @@PROGRAM OF TRAVERSING@@ Node currentNode=Start while(currentNode!=NULL) {         console.WriteLine(currentNode.Marked) currentNode=currentNode.next; }
 * OPERATION IN SINGLE LINKED LIST*
 * 1) ALGORITHM OF TRAVERSING##