Unit IV
Unit IV
It uses stack for managing the It uses heap for managing the dynamic
3
static allocation of memory allocation of memory
1) The size of the arrays is fixed: So we must know the upper limit on the
number of elements in advance. Also, generally, the allocated memory is
equal to the upper limit irrespective of the usage.
2) Extra memory space for a pointer is required with each element of the
list.
2. Linked lists let you insert elements at the beginning and end
of the list.
ADT Operation :
• Hence each node has knowledge of its successor and also its
predecessor.
Link − Each link of a linked list can store a data called an element.
Next − Each link of a linked list contains a link to the next link called Next.
Prev − Each link of a linked list contains a link to the previous link called
Prev.
Linked List − A Linked List contains the connection link to the first link
called First and to the last link called Last.
1. A DLL can be traversed in both forward and backward
direction.