01/10/2019
https://youtu.be/hsmHTaY9E-E
what is link list ?
A linked list is a way to store a collection of elements. Like an array these can be character or integers. Each element in a linked list is stored in the form of a node.
A node is a collection of two sub-elements or parts. A Key part that stores the element and a Link part that stores the link to the next node.
======some import function ===============
typedef : is used to define a data type in C.
malloc() : is used to dynamically allocate a single block of memory in C, it is available in the header file stdlib.h.
sizeof() : is used to determine size in bytes of an element in C. Here it is used to determine size of each node and sent as a parameter to malloc.
-------------------------------------------------------------------------------------------------------------------------------------------------------
================Advantages of Link List ================
-Linked List is Dynamic data Structure .
-Linked List can grow and shrink during run time.
-Insertion and Deletion Operations are Easier
-Efficient Memory Utilization ,i.e no need to pre-allocate memory
-Faster Access time,can be expanded in constant time without memory overhead
-Linear Data Structures such as Stack,Queue can be easily implemented using Linked list
=======================Few disadvantages of linked lists are :======================
- They use more memory than arrays because of the storage used by their pointers.
- Difficulties arise in linked lists when it comes to reverse traversing. For instance, singly linked - Lists are cumbersome to navigate backwards and while doubly linked lists are somewhat
easier to read, memory is wasted in allocating space for a back-pointer.
-Nodes in a linked list must be read in order from the beginning as linked lists are inherently
sequential access.
- Nodes are stored incontiguously, greatly increasing the time required to access individual
elements within the list, especially with a CPU cache.
https://youtu.be/qJ_m-xuKIUA what is link list ? A linked list is a way to store a collection of elements. Like an array these can be character or integers. ...