Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
html
What is Linked LIST?
A linked list is a data structure consisting of a group of nodes which together represent a
sequence. Under the simplest form, each node is composed of a data and a reference
(in other words, a link) to the next node in the sequence. Link is a pointer to next node.
Node ::
2. No random access. In array if we want to access the nth element, we can access by
array[n]. But in Linked LIST, we need to traverse n times .
What are the types of Linked List?
Singly Linked List
Types of linked lists are ... In an array implementation, read pointer as index.
Singly linked - there is a head pointer, and one next pointer per element. The last
element's pointer is null. This type of list can be traversed in only one direction.
Doubly linked - there is a head pointer, and each element contains two pointers, one to
the previous element and one to the next element. This type of list can be traversed in two
directions, making insertion and deletion a bit easier, at the cost of extra memory.
Circularly linked - the same as Singly or Doubly linked, except that the last element's
pointer points back to the first element's pointer. These types of lists are often used as
queues.