Posts

Doubly linked list

Image
Doubly linked list. In doubly linked list each node is divided into three parts. 1.LINK:- It holds address of previous node of linked list. 2.INFO:-It holds value of node. 3. RLINK:-It holds address of next node In doubly linked list LINK part of first node and RLINK of last node always contain NULL.     Advantage: It is use to avoid the drawback of singly linked list.we know that in singly linked list we can traversed node left to right/foreword direction but doubly linked list supports bidirectional traversing/both backward and foreword direction Disadvantage: It uses more memory space rather than singly linked list because it consist left and right pointer. (If you not read previous topic singly linked list click on link) ↧           singly linked list program choice based Doubly linked list  program choice base #include<stdio.h> #include<conio.h> #include<stdlib.h> #include<process.h> ...

linked list in C

Image
linked list in c    Linked list It is a collection of nodes which are linked each other.A node consist of element and memory address                              One major advantage of linked list is that is support dynamic memory allocation so in this case memory is not wasted.The size of array is full this concept is known as overflow but in linked list overflow does not accrued,it means linked list have unlimited number of nodes. There is three types of linked list.  Types of linked list 1. Singly linked list 2. Doubly linked list 3. Circular linked list Singly linked list In this linked list each node is divided into two parts one part is called "info" and second part is called "LINK". "INFO" part represent value of node and "LINK" part represent memory address of next node.In linked list link part of last node must have "NULL" which represent no any node is...

Searching and sorting in array

Image
                   Searching and sorting in array   Searching in array. It is a process in which we search particular element in array.  example:  program for searching a element in array. 10 20 30 40 50 0              1              2              3              4 In above example we can find any element of array. now  i am going to write code---- #include <stdio.h> #include <stdlib.h> void search( int a[],int size, int element) {     int i,flag=0;     for(i=0;i<size;i++)     {       if(a[i]==element)       { ...