- If fix element is required for an operation then link list is not a good option because it’s consumed more memory to manage the dynamic address for the list.
- Random traversal is not possible in link list due to dynamic memory allocation which is unpredictable and scarred in memory.
- Reverse traversing is not possible in a single link list because only the next pointer is used to point next element.
- Manual delete is required because link list uses memory in heap section.
- Infinite traversal occurred in a circular list if not handled properly.
- More Time and memory required compare to array.
Monday 13 July 2020
Link List Disadvantage
![](http://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieQnBSliKz82rpTOE_CwtauoRRhbVXzQKffAPOYJrMBCWXt8R-uY8Wj5VCbOBe8OSDzP0rwTYMX096G3LZSd-NCs8tLFpBtawL_VjoBPOzBFDXvVQJnUL_9BjVAn0tSV8/s113/girfa-face.jpg)
Pointer and Array Relationship
Pointers and arrays have a special relationship in C
Language.Name of an array is constant pointer which point first element of
array and an array is represented by a variable that is associated with the
address of its first storage location. A pointer is also the address of a
storage location with a defined type, so name permits the use of the array [ ]
index notation with both pointer variables and array variables. For example,
the following two references in C language are equivalent in meaning:
Q = &a[0]; trace(Q[2]);
trace(Q[2]);
![](http://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieQnBSliKz82rpTOE_CwtauoRRhbVXzQKffAPOYJrMBCWXt8R-uY8Wj5VCbOBe8OSDzP0rwTYMX096G3LZSd-NCs8tLFpBtawL_VjoBPOzBFDXvVQJnUL_9BjVAn0tSV8/s113/girfa-face.jpg)
Saturday 11 July 2020
Greatest find CM:MM with structure | C Language
Q : Define a structure Distance having two data members: cm and mm in integer. The program enters three variables and find which distance is the largest among them.
Answer
#include<stdio.h>
#include<conio.h>
/*============================
Girfa Student Help
Find greatest cm:mm using structure
==============================*/
![](http://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieQnBSliKz82rpTOE_CwtauoRRhbVXzQKffAPOYJrMBCWXt8R-uY8Wj5VCbOBe8OSDzP0rwTYMX096G3LZSd-NCs8tLFpBtawL_VjoBPOzBFDXvVQJnUL_9BjVAn0tSV8/s113/girfa-face.jpg)
Recursion
![](http://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieQnBSliKz82rpTOE_CwtauoRRhbVXzQKffAPOYJrMBCWXt8R-uY8Wj5VCbOBe8OSDzP0rwTYMX096G3LZSd-NCs8tLFpBtawL_VjoBPOzBFDXvVQJnUL_9BjVAn0tSV8/s113/girfa-face.jpg)
Subscribe to:
Posts (Atom)